From 0b7bae3eed6f30b72c8fbd9df5a12aa45d51cca8 Mon Sep 17 00:00:00 2001 From: petegregoryy Date: Thu, 11 Dec 2025 14:28:58 +0000 Subject: [PATCH] Update .gitea/workflows/release.yml --- .gitea/workflows/release.yml | 158 ++++++++++++++++++++--------------- 1 file changed, 92 insertions(+), 66 deletions(-) diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 3d3631d..8ac7614 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -174,79 +174,105 @@ jobs: path: app-windows-x64.zip release-dev: - runs-on: ubuntu-latest - if: ${{ github.ref_name == 'dev' }} - needs: - - meta - - android-build - - linux-build - - windows-build - steps: - - name: Note branch (dev release) - run: echo "Not dev branch (${GITHUB_REF_NAME}), release-dev will be skipped." + runs-on: ubuntu-latest + if: ${{ github.ref == 'refs/heads/dev' }} + needs: + - meta + - android-build + - linux-build + # - windows-build # see below + steps: + - name: Download Android APK + uses: actions/download-artifact@v3 + with: + name: android-apk + path: artifacts - - name: Download Android APK - uses: actions/download-artifact@v3 - with: - name: android-apk - path: artifacts + - name: Download Linux bundle + uses: actions/download-artifact@v3 + with: + name: linux-bundle + path: artifacts - - name: Download Linux bundle - uses: actions/download-artifact@v3 - with: - name: linux-bundle - path: artifacts + - name: Download Windows bundle (optional) + if: ${{ env.BUILD_WINDOWS == 'true' }} + uses: actions/download-artifact@v3 + with: + name: windows-zip + path: artifacts - - name: Download Windows bundle (optional) - if: ${{ env.BUILD_WINDOWS == 'true' }} - uses: actions/download-artifact@v3 - with: - name: windows-zip - path: artifacts + - name: Prepare artefacts and tag + id: bundle + run: | + BASE="${{ needs.meta.outputs.base_version }}" + TAG="v${BASE}-dev" - - name: Prepare artefacts and tag - id: bundle - run: | - BASE="${{ needs.meta.outputs.base_version }}" - TAG="v${BASE}-dev" + mv artifacts/app-release.apk "artifacts/app-${BASE}-dev.apk" + mv artifacts/app-linux-x64.tar.gz "artifacts/app-linux-x64-${BASE}-dev.tar.gz" + if [ -f artifacts/app-windows-x64.zip ]; then + mv artifacts/app-windows-x64.zip "artifacts/app-windows-x64-${BASE}-dev.zip" + fi - mv artifacts/app-release.apk "artifacts/app-${BASE}-dev.apk" - mv artifacts/app-linux-x64.tar.gz "artifacts/app-linux-x64-${BASE}-dev.tar.gz" - if [ -f artifacts/app-windows-x64.zip ]; then - mv artifacts/app-windows-x64.zip "artifacts/app-windows-x64-${BASE}-dev.zip" - fi + echo "tag=${TAG}" >> "$GITHUB_OUTPUT" + echo "files=artifacts/*" >> "$GITHUB_OUTPUT" - echo "tag=${TAG}" >> "$GITHUB_OUTPUT" - echo "files=artifacts/*" >> "$GITHUB_OUTPUT" - - - name: Create prerelease on Gitea - uses: ncipollo/release-action@v1 - with: - tag: ${{ steps.bundle.outputs.tag }} - name: ${{ steps.bundle.outputs.tag }} - prerelease: true - token: ${{ secrets.GITEA_TOKEN }} - artifacts: ${{ steps.bundle.outputs.files }} + - name: Create prerelease on Gitea + uses: ncipollo/release-action@v1 + with: + tag: ${{ steps.bundle.outputs.tag }} + name: ${{ steps.bundle.outputs.tag }} + prerelease: true + token: ${{ secrets.GITEA_TOKEN }} + artifacts: ${{ steps.bundle.outputs.files }} release-master: - runs-on: ubuntu-latest - if: ${{ github.ref_name == 'master' }} - needs: - - meta - - android-build - - linux-build - - windows-build - steps: - - name: Note branch (master release) - if: ${{ github.ref_name != 'master' }} - run: echo "Not master branch (${GITHUB_REF_NAME}), release-master will be skipped." + runs-on: ubuntu-latest + if: ${{ github.ref == 'refs/heads/master' }} + needs: + - meta + - android-build + - linux-build + # - windows-build + steps: + - name: Download Android APK + uses: actions/download-artifact@v3 + with: + name: android-apk + path: artifacts - - name: Download Android APK - if: ${{ github.ref_name == 'master' }} - uses: actions/download-artifact@v3 - with: - name: android-apk - path: artifacts + - name: Download Linux bundle + uses: actions/download-artifact@v3 + with: + name: linux-bundle + path: artifacts - - name: Download Linux bundle - if: ${{ github.ref_name == 'master' }} + - name: Download Windows bundle (optional) + if: ${{ env.BUILD_WINDOWS == 'true' }} + uses: actions/download-artifact@v3 + with: + name: windows-zip + path: artifacts + + - name: Prepare artefacts and tag + id: bundle + run: | + BASE="${{ needs.meta.outputs.base_version }}" + TAG="v${BASE}" + + mv artifacts/app-release.apk "artifacts/app-${BASE}.apk" + mv artifacts/app-linux-x64.tar.gz "artifacts/app-linux-x64-${BASE}.tar.gz" + if [ -f artifacts/app-windows-x64.zip ]; then + mv artifacts/app-windows-x64.zip "artifacts/app-windows-x64-${BASE}.zip" + fi + + echo "tag=${TAG}" >> "$GITHUB_OUTPUT" + echo "files=artifacts/*" >> "$GITHUB_OUTPUT" + + - name: Create release on Gitea + uses: ncipollo/release-action@v1 + with: + tag: ${{ steps.bundle.outputs.tag }} + name: ${{ steps.bundle.outputs.tag }} + prerelease: false + token: ${{ secrets.GITEA_TOKEN }} + artifacts: ${{ steps.bundle.outputs.files }}