Merge pull request '[CI] name the test release after the latest v*-dev tag' (#2448) from earl-warren/forgejo:wip-release-number into forgejo

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2448
This commit is contained in:
Earl Warren 2024-02-23 16:31:51 +00:00
commit b8563acedb
3 changed files with 4 additions and 4 deletions

View file

@ -110,7 +110,7 @@ jobs:
# #
# Push a commit to a branch that triggers the build of a test release # Push a commit to a branch that triggers the build of a test release
# #
version=0.0-test version=1.2-test
( (
git clone $url/root/forgejo /tmp/forgejo git clone $url/root/forgejo /tmp/forgejo
cd /tmp/forgejo cd /tmp/forgejo

View file

@ -54,7 +54,7 @@ jobs:
ref="${{ github.ref }}" ref="${{ github.ref }}"
if [[ $ref =~ ^refs/heads/ ]] ; then if [[ $ref =~ ^refs/heads/ ]] ; then
if test "$ref" = "refs/heads/forgejo" ; then if test "$ref" = "refs/heads/forgejo" ; then
version=0.0-test version=$(git tag -l --sort=version:refname --merged | grep -v -e '-test$' | tail -1 | sed -E -e 's/^(v[0-9]+\.[0-9]+).*/\1/')-test
else else
version=${ref#refs/heads/} version=${ref#refs/heads/}
version=${version%/forgejo}-test version=${version%/forgejo}-test
@ -70,7 +70,7 @@ jobs:
exit 1 exit 1
fi fi
version=${version#v} version=${version#v}
git describe --tags --always git describe --exclude '*-test' --tags --always
echo "sha=${{ github.sha }}" >> "$GITHUB_OUTPUT" echo "sha=${{ github.sha }}" >> "$GITHUB_OUTPUT"
echo "version=$version" >> "$GITHUB_OUTPUT" echo "version=$version" >> "$GITHUB_OUTPUT"
echo "override=$override" >> "$GITHUB_OUTPUT" echo "override=$override" >> "$GITHUB_OUTPUT"

View file

@ -90,7 +90,7 @@ STORED_VERSION=$(shell cat $(STORED_VERSION_FILE) 2>/dev/null)
ifneq ($(STORED_VERSION),) ifneq ($(STORED_VERSION),)
FORGEJO_VERSION ?= $(STORED_VERSION) FORGEJO_VERSION ?= $(STORED_VERSION)
else else
FORGEJO_VERSION ?= $(shell git describe --tags --always | sed 's/-/+/' | sed 's/^v//') FORGEJO_VERSION ?= $(shell git describe --exclude '*-test' --tags --always | sed 's/-/+/' | sed 's/^v//')
endif endif
RELEASE_VERSION ?= ${FORGEJO_VERSION} RELEASE_VERSION ?= ${FORGEJO_VERSION}
VERSION ?= ${RELEASE_VERSION} VERSION ?= ${RELEASE_VERSION}