From e5c49e970abe743e0cd7bbcd827ccff595fe39b8 Mon Sep 17 00:00:00 2001 From: Florian Brinker Date: Fri, 20 Sep 2024 13:15:06 +0200 Subject: [PATCH] 1 workflow to rule them all --- .gitea/workflows/workflow.yaml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.gitea/workflows/workflow.yaml b/.gitea/workflows/workflow.yaml index ca48b4f..a929609 100644 --- a/.gitea/workflows/workflow.yaml +++ b/.gitea/workflows/workflow.yaml @@ -16,6 +16,8 @@ jobs: needs: [Linting] if: ${{ ! startsWith(github.ref, 'refs/tags/') }} runs-on: ubuntu-latest + env: + VERSION: ${{ gitea.ref_name }} steps: - name: Check out repository code uses: actions/checkout@v4 @@ -31,23 +33,22 @@ jobs: rm -f sources/.luacheckrc - name: Set Version and AddonVersion run: | - echo "Version: $GITHUB_REF_NAME" - export VERSION=$GITHUB_REF_NAME - export ADDON_VERSION=$(echo $GITHUB_REF_NAME | sed -E 's/(0|)\.//g') + echo "Version: $VERSION" + export ADDON_VERSION=$(echo $VERSION | sed -E 's/(0|)\.//g') sed -i "s/0.123456789/$VERSION/g" sources/AchievementInfoCommon.lua sed -i "s/0.123456789/$VERSION/g" sources/AchievementInfo.txt sed -i "s/0.123456789/$ADDON_VERSION/g" sources/AchievementInfo.txt - name: Rename and zip run: | mv sources AchievementInfo - zip -r "AchievementInfo-$GITHUB_REF_NAME.zip" ./AchievementInfo + zip -r "AchievementInfo-$VERSION.zip" ./AchievementInfo - name: Create release id: create_release uses: akkuman/gitea-release-action@v1 with: token: ${{ secrets.token }} - name: AchievementInfo $GITHUB_REF_NAME - tag_name: $GITHUB_REF_NAME + name: "AchievementInfo $VERSION" + tag_name: "$VERSION" body_path: AchievementInfo/CHANGELOG.md draft: true prerelease: false