Update .gitea/workflows/release.yml

This commit is contained in:
2025-12-11 14:28:58 +00:00
parent a5c5d50f5a
commit 0b7bae3eed

View File

@@ -174,79 +174,105 @@ jobs:
path: app-windows-x64.zip path: app-windows-x64.zip
release-dev: release-dev:
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: ${{ github.ref_name == 'dev' }} if: ${{ github.ref == 'refs/heads/dev' }}
needs: needs:
- meta - meta
- android-build - android-build
- linux-build - linux-build
- windows-build # - windows-build # see below
steps: steps:
- name: Note branch (dev release) - name: Download Android APK
run: echo "Not dev branch (${GITHUB_REF_NAME}), release-dev will be skipped." uses: actions/download-artifact@v3
with:
name: android-apk
path: artifacts
- name: Download Android APK - name: Download Linux bundle
uses: actions/download-artifact@v3 uses: actions/download-artifact@v3
with: with:
name: android-apk name: linux-bundle
path: artifacts path: artifacts
- name: Download Linux bundle - name: Download Windows bundle (optional)
uses: actions/download-artifact@v3 if: ${{ env.BUILD_WINDOWS == 'true' }}
with: uses: actions/download-artifact@v3
name: linux-bundle with:
path: artifacts name: windows-zip
path: artifacts
- name: Download Windows bundle (optional) - name: Prepare artefacts and tag
if: ${{ env.BUILD_WINDOWS == 'true' }} id: bundle
uses: actions/download-artifact@v3 run: |
with: BASE="${{ needs.meta.outputs.base_version }}"
name: windows-zip TAG="v${BASE}-dev"
path: artifacts
- name: Prepare artefacts and tag mv artifacts/app-release.apk "artifacts/app-${BASE}-dev.apk"
id: bundle mv artifacts/app-linux-x64.tar.gz "artifacts/app-linux-x64-${BASE}-dev.tar.gz"
run: | if [ -f artifacts/app-windows-x64.zip ]; then
BASE="${{ needs.meta.outputs.base_version }}" mv artifacts/app-windows-x64.zip "artifacts/app-windows-x64-${BASE}-dev.zip"
TAG="v${BASE}-dev" fi
mv artifacts/app-release.apk "artifacts/app-${BASE}-dev.apk" echo "tag=${TAG}" >> "$GITHUB_OUTPUT"
mv artifacts/app-linux-x64.tar.gz "artifacts/app-linux-x64-${BASE}-dev.tar.gz" echo "files=artifacts/*" >> "$GITHUB_OUTPUT"
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" - name: Create prerelease on Gitea
echo "files=artifacts/*" >> "$GITHUB_OUTPUT" uses: ncipollo/release-action@v1
with:
- name: Create prerelease on Gitea tag: ${{ steps.bundle.outputs.tag }}
uses: ncipollo/release-action@v1 name: ${{ steps.bundle.outputs.tag }}
with: prerelease: true
tag: ${{ steps.bundle.outputs.tag }} token: ${{ secrets.GITEA_TOKEN }}
name: ${{ steps.bundle.outputs.tag }} artifacts: ${{ steps.bundle.outputs.files }}
prerelease: true
token: ${{ secrets.GITEA_TOKEN }}
artifacts: ${{ steps.bundle.outputs.files }}
release-master: release-master:
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: ${{ github.ref_name == 'master' }} if: ${{ github.ref == 'refs/heads/master' }}
needs: needs:
- meta - meta
- android-build - android-build
- linux-build - linux-build
- windows-build # - windows-build
steps: steps:
- name: Note branch (master release) - name: Download Android APK
if: ${{ github.ref_name != 'master' }} uses: actions/download-artifact@v3
run: echo "Not master branch (${GITHUB_REF_NAME}), release-master will be skipped." with:
name: android-apk
path: artifacts
- name: Download Android APK - name: Download Linux bundle
if: ${{ github.ref_name == 'master' }} uses: actions/download-artifact@v3
uses: actions/download-artifact@v3 with:
with: name: linux-bundle
name: android-apk path: artifacts
path: artifacts
- name: Download Linux bundle - name: Download Windows bundle (optional)
if: ${{ github.ref_name == 'master' }} 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 }}