From 2c86dca627b59a69ebe3ffe48d445630047629d8 Mon Sep 17 00:00:00 2001 From: Florian Brinker Date: Fri, 20 Sep 2024 03:45:06 +0200 Subject: [PATCH] Change demo --- .gitea/workflows/1_build_and_release.yaml | 55 +++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .gitea/workflows/1_build_and_release.yaml diff --git a/.gitea/workflows/1_build_and_release.yaml b/.gitea/workflows/1_build_and_release.yaml new file mode 100644 index 0000000..cf2ba9b --- /dev/null +++ b/.gitea/workflows/1_build_and_release.yaml @@ -0,0 +1,55 @@ +name: Build & Release +run-name: ${{ gitea.actor }} is creating a new release 🚀 +on: [push] + #push: + #tags: + # - '*' + +jobs: + Build: + runs-on: ubuntu-latest + steps: + - name: Check out repository code + uses: actions/checkout@v4 + with: + path: sources + - name: Delete unneeded files/dirs + run: | + rm -rf sources/.git + rm -rf sources/.gitea + rm -rf sources/screenshots + rm -f sources/.drone.status + rm -f sources/.drone.yml + 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') + 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 + - name: Create release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITEATOKEN }} + with: + tag_name: $GITHUB_REF_NAME + release_name: AchievementInfo $GITHUB_REF_NAME + body_path: AchievementInfo/CHANGELOG.md + draft: true + prerelease: false + - name: Upload release asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITEATOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./AchievementInfo-$GITHUB_REF_NAME.zip + asset_name: AchievementInfo-$GITHUB_REF_NAME.zip + asset_content_type: application/zip \ No newline at end of file