From 83646119fb8af975a114601ee7bbaf7c5d25f93f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Dachary?= Date: Sat, 19 Nov 2022 11:41:18 +0100 Subject: [PATCH] [CI] implementation: publish forgejo- binaries instead of gitea- (cherry picked from commit 6d910daafb28b79402b8190fa749f4ff18991505) (cherry picked from commit d447861cc911aa89539cbbcdbbf0e68d0bc23e53) (cherry picked from commit dc6e9d87990f72d870100934be32a5fc1dc119ad) (cherry picked from commit ef232fa20c99c6c52599025967a5af2f5839bdce) (cherry picked from commit 290c55517a84f6e8b80459372b9b63ec19cadcb4) (cherry picked from commit db48af1784e94851c066845324c3e680e79ab7c3) (cherry picked from commit 85f33237a2f5da88ec2fcab76ea91ee3cec56065) (cherry picked from commit 76899ee33e8196c66f882fca5facf5268c8fabf8) (cherry picked from commit 148b3ee9cb03aa614b59ab98d2d8c11f343d38d1) (cherry picked from commit 1f6ad8f465819cc6adb8061845822398a33e14e1) (cherry picked from commit c330afdba3354ff59591bd07046b6993bfeea777) (cherry picked from commit b1f87075a79c8e0d1a8626958f90bfee4d003de1) (cherry picked from commit 7da40992cc82d719094a748339c385fbc1251afe) (cherry picked from commit 7ab19ff5e528b9e1ef53e95639022facca70466e) (cherry picked from commit e61e44921bbabc7ba12da51afde1c6fe8203679b) --- Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 664839273b..056e674e39 100644 --- a/Makefile +++ b/Makefile @@ -84,7 +84,7 @@ ifneq ($(DRONE_TAG),) GITEA_VERSION ?= $(VERSION) else ifneq ($(DRONE_BRANCH),) - VERSION ?= $(subst release/v,,$(DRONE_BRANCH)) + VERSION ?= $(shell echo $(DRONE_BRANCH) | sed -e 's|v\([0-9.][0-9.]*\)/.*|\1|') else VERSION ?= main endif @@ -837,7 +837,7 @@ endif .PHONY: release-linux release-linux: | $(DIST_DIRS) - CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) run $(XGO_PACKAGE) -go $(XGO_VERSION) -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -targets '$(LINUX_ARCHS)' -out gitea-$(VERSION) . + CGO_CFLAGS="$(CGO_CFLAGS)" $(GO) run $(XGO_PACKAGE) -go $(XGO_VERSION) -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -targets '$(LINUX_ARCHS)' -out forgejo-$(VERSION) . ifeq ($(CI),true) cp /build/* $(DIST)/binaries endif @@ -874,8 +874,8 @@ release-sources: | $(DIST_DIRS) # bsdtar needs a ^ to prevent matching subdirectories $(eval EXCL := --exclude=$(shell tar --help | grep -q bsdtar && echo "^")./) # use transform to a add a release-folder prefix; in bsdtar the transform parameter equivalent is -s - $(eval TRANSFORM := $(shell tar --help | grep -q bsdtar && echo "-s '/^./gitea-src-$(VERSION)/'" || echo "--transform 's|^./|gitea-src-$(VERSION)/|'")) - tar $(addprefix $(EXCL),$(TAR_EXCLUDES)) $(TRANSFORM) -czf $(DIST)/release/gitea-src-$(VERSION).tar.gz . + $(eval TRANSFORM := $(shell tar --help | grep -q bsdtar && echo "-s '/^./forgejo-src-$(VERSION)/'" || echo "--transform 's|^./|forgejo-src-$(VERSION)/|'")) + tar $(addprefix $(EXCL),$(TAR_EXCLUDES)) $(TRANSFORM) -czf $(DIST)/release/forgejo-src-$(VERSION).tar.gz . rm -f $(STORED_VERSION_FILE) .PHONY: release-docs