From 2e02619fdbf3d7f247f2e10b4c496098079d2924 Mon Sep 17 00:00:00 2001 From: servostar Date: Mon, 25 Nov 2024 12:17:58 +0000 Subject: [PATCH] ci/version-as-env (#97) Release-As: v0.5.3 Reviewed-on: https://git.montehaselino.de/DHBW/dhbw-abb-typst-template/pulls/97 Co-authored-by: servostar Co-committed-by: servostar --- .gitea/workflows/release.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 3d002f7..df4a2ed 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -58,13 +58,16 @@ jobs: - name: Prepare Release run: echo ${{ github.sha }} > Release.txt - name: Tag Release Commit + env: + COMMIT_MESSAGE: ${{github.event.head_commit.message}} run: | - echo ${{github.event.head_commit.message}} | grep -Po '(?<=Release-As: )v\d+\.\d+\.\d+' > Version.txt - echo "==> Tagging for version: $(cat Version.txt)" + export VERSION=$(echo "${COMMIT_MESSAGE}" | grep -Po '(?<=Release-As: )v\d+\.\d+\.\d+') + echo "==> Tagging for version: ${VERSION}" git config --global credential.helper store echo "https://${USERNAME}:${{secrets.RELEASE_TOKEN}}}@${{github.repositoryUrl}}" > ~/.git-credentials - git tag -m "Release" "$(cat Version.txt)" - git push ${{github.repositoryUrl}} "$(cat Version.txt)" + git tag -m "Release" "${VERSION}" + git push origin "${VERSION}" + echo "${VERSION}" > Version.txt - name: Create release id: create-release uses: https://gitea.com/actions/release-action@main