From 5dda8872b5b90cf74f97f3f8403be2cc03bdf764 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Sun, 10 Nov 2024 09:37:56 +0100 Subject: [PATCH] .github: add support for prerelease/latest tagging Synced from Finit release.yml Signed-off-by: Joachim Wiberg --- .github/workflows/release.yml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 85c9cf9..e068568 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,13 +16,28 @@ jobs: run: | sudo apt-get -y update sudo apt-get -y install pkg-config libsystemd-dev + - name: Setting release variables ... + id: build + run: | + ver=${GITHUB_REF#refs/tags/} + echo "ver=${ver}" >> $GITHUB_OUTPUT + if echo $ver | grep -qE '^[0-9]+\.[0-9]+(\.[0-9]+)?(-alpha|-beta|-rc)[0-9]*$'; then + echo "pre=true" >> $GITHUB_OUTPUT + else + echo "pre=false" >> $GITHUB_OUTPUT + fi + if echo $ver | grep -qE '^[0-9.]+\.[0-9.]+(\.[0-9]+)?$'; then + echo "latest=true" >> $GITHUB_OUTPUT + else + echo "latest=false" >> $GITHUB_OUTPUT + fi - name: Creating Makefiles ... run: | ./autogen.sh ./configure - name: Build release ... run: | - make release + make release || (cat test/test-suite.log; false) ls -lF ../ mkdir -p artifacts/ mv ../*.tar.* artifacts/ @@ -34,5 +49,7 @@ jobs: - uses: ncipollo/release-action@v1 with: name: mrouted v${{ github.ref_name }} + prerelease: ${{ steps.build.outputs.pre }} + makeLatest: ${{ steps.build.outputs.latest }} bodyFile: "release.md" artifacts: "artifacts/*"