Skip to content

Commit db3b867

Browse files
committed
[RELEASE] Gitea version is for interoperability only
Forgejo now has its own lifecycle and its version is derived from the tag. The Gitea tags are no longer found in the Forgejo codebase and can no longer be used for that purpose. When a Forgejo release is published, for interoperability with the existing tools in the ecosystem, it advertises the supported Gitea version via /api/v1/version. It is set in the Makefile manually and cannot be automatically set. https://codeberg.org/forgejo-contrib/delightful-forgejo#packaging Existing Forgejo packages rely on the Makefile to build and the change must be done in a way that tries to not break their assumptions. From the point of view of a Forgejo package build, the following will happen on the next major release: - The package version will bump from v1.21.x to v7.0.0 - /api/v1/version will bump from v1.21.x to v1.22.0 - /api/forgejo/v1/version will bump from v6.x to v7.0.0 The Makefile uses the following variables: GITEA_VERSION is returned by /api/v1/version FORGEJO_VERSION is returned by /api/forgejo/v1/version VERSION is used in the name the binary file and the source archive Before: GITEA_VERSION is the computed version FORGEJO_VERSION is set manually VERSION defaults to GITEA_VERSION After: FORGEJO_VERSION is the computed version GITEA_VERSION is set manually VERSION defaults to FORGEJO_VERSION When the version is computed, it comes from: - The content of the VERSION file if it exists. It is inserted in the source archive because it does not contain a git repository - Otherwise the output of `git describe`
1 parent 7b4dba3 commit db3b867

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

Makefile

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,13 @@ HUGO_VERSION ?= 0.111.3
8888

8989
STORED_VERSION=$(shell cat $(STORED_VERSION_FILE) 2>/dev/null)
9090
ifneq ($(STORED_VERSION),)
91-
GITEA_VERSION ?= $(STORED_VERSION)
91+
FORGEJO_VERSION ?= $(STORED_VERSION)
9292
else
93-
GITEA_VERSION ?= $(shell git describe --tags --always | sed 's/-/+/' | sed 's/^v//')
93+
FORGEJO_VERSION ?= $(shell git describe --tags --always | sed 's/-/+/' | sed 's/^v//')
9494
endif
95-
VERSION = ${GITEA_VERSION}
95+
VERSION ?= ${FORGEJO_VERSION}
9696

97-
# SemVer
98-
FORGEJO_VERSION := 7.0.0+0-gitea-1.22.0
97+
GITEA_VERSION ?= 1.22.0
9998

10099
LDFLAGS := $(LDFLAGS) -X "main.MakeVersion=$(MAKE_VERSION)" -X "main.Version=$(GITEA_VERSION)" -X "main.Tags=$(TAGS)" -X "main.ForgejoVersion=$(FORGEJO_VERSION)"
101100

0 commit comments

Comments
 (0)