mktools/tasks/gitea.mk

38 lines
1.5 KiB
Makefile

MKT_GITEA_RELEASE_PROJECT ?=
MKT_GITEA_RELEASE_ORG ?=
MKT_GITEA_RELEASE_BASE_URL ?= https://forge.cadoles.com
MKT_GITEA_RELEASE_VERSION ?= $(MKT_PROJECT_VERSION)
MKT_GITEA_RELEASE_COMMIT_TARGET ?= $(shell git rev-parse HEAD)
MKT_GITEA_RELEASE_IS_DRAFT ?= false
MKT_GITEA_RELEASE_BODY ?=
MKT_GITEA_RELEASE_ATTACHMENTS ?=
MKT_GITEA_RELEASE_USERNAME ?=
MKT_GITEA_RELEASE_PASSWORD ?=
define GITEA_RELEASE_BODY
$(MKT_GITEA_RELEASE_BODY)
endef
export GITEA_RELEASE_BODY
define GITEA_RELEASE_ATTACHMENTS
$(MKT_GITEA_RELEASE_ATTACHMENTS)
endef
export GITEA_RELEASE_ATTACHMENTS
mkt-gitea-release: tools/gitea-release/bin/gitea-release.sh
GITEA_RELEASE_PROJECT="$(MKT_GITEA_RELEASE_PROJECT)" \
GITEA_RELEASE_ORG="$(MKT_GITEA_RELEASE_ORG)" \
GITEA_RELEASE_BASE_URL="$(MKT_GITEA_RELEASE_BASE_URL)" \
GITEA_RELEASE_VERSION="$(MKT_GITEA_RELEASE_VERSION)" \
GITEA_RELEASE_NAME="$(MKT_GITEA_RELEASE_VERSION)" \
GITEA_RELEASE_COMMITISH_TARGET="$(MKT_GITEA_RELEASE_COMMIT_TARGET)" \
GITEA_RELEASE_IS_DRAFT="$(MKT_GITEA_RELEASE_IS_DRAFT)" \
GITEA_RELEASE_USERNAME="$(MKT_GITEA_RELEASE_USERNAME)" \
GITEA_RELEASE_PASSWORD="$(MKT_GITEA_RELEASE_PASSWORD)" \
tools/gitea-release/bin/gitea-release.sh
tools/gitea-release/bin/gitea-release.sh:
mkdir -p tools/gitea-release/bin
curl --output tools/gitea-release/bin/gitea-release.sh https://forge.cadoles.com/Cadoles/Jenkins/raw/branch/master/resources/com/cadoles/gitea/gitea-release.sh
chmod +x tools/gitea-release/bin/gitea-release.sh
grep -qF -- "tools/" ".gitignore" 2>/dev/null || echo "tools/" >> ".gitignore"