Update .gitea/workflows/release.yml
Some checks failed
Release / meta (push) Successful in 8s
Release / linux-build (push) Successful in 1m57s
Release / android-build (push) Successful in 6m33s
Release / windows-build (push) Has been cancelled
Release / release-dev (push) Has been cancelled
Release / release-master (push) Has been cancelled
Some checks failed
Release / meta (push) Successful in 8s
Release / linux-build (push) Successful in 1m57s
Release / android-build (push) Successful in 6m33s
Release / windows-build (push) Has been cancelled
Release / release-dev (push) Has been cancelled
Release / release-master (push) Has been cancelled
This commit is contained in:
@@ -136,72 +136,78 @@ jobs:
|
|||||||
windows-build:
|
windows-build:
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
needs: meta
|
needs: meta
|
||||||
# Job always runs; individual steps are gated so release jobs can still depend on it.
|
# Job always runs; steps are conditional so release jobs can safely depend on it.
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
if: env.BUILD_WINDOWS == 'true'
|
if: ${{ env.BUILD_WINDOWS == 'true' }}
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup Flutter
|
- name: Setup Flutter
|
||||||
if: env.BUILD_WINDOWS == 'true'
|
if: ${{ env.BUILD_WINDOWS == 'true' }}
|
||||||
uses: subosito/flutter-action@v2
|
uses: subosito/flutter-action@v2
|
||||||
with:
|
with:
|
||||||
channel: ${{ env.FLUTTER_CHANNEL }}
|
channel: ${{ env.FLUTTER_CHANNEL }}
|
||||||
|
|
||||||
- name: Allow all git directories (CI)
|
- name: Allow all git directories (CI)
|
||||||
if: env.BUILD_WINDOWS == 'true'
|
if: ${{ env.BUILD_WINDOWS == 'true' }}
|
||||||
run: git config --global --add safe.directory '*'
|
run: git config --global --add safe.directory '*'
|
||||||
|
|
||||||
- name: Flutter dependencies
|
- name: Flutter dependencies
|
||||||
if: env.BUILD_WINDOWS == 'true'
|
if: ${{ env.BUILD_WINDOWS == 'true' }}
|
||||||
run: flutter pub get
|
run: flutter pub get
|
||||||
|
|
||||||
- name: Enable Windows desktop
|
- name: Enable Windows desktop
|
||||||
if: env.BUILD_WINDOWS == 'true'
|
if: ${{ env.BUILD_WINDOWS == 'true' }}
|
||||||
run: flutter config --enable-windows-desktop
|
run: flutter config --enable-windows-desktop
|
||||||
|
|
||||||
- name: Build Windows binary (release)
|
- name: Build Windows binary (release)
|
||||||
if: env.BUILD_WINDOWS == 'true'
|
if: ${{ env.BUILD_WINDOWS == 'true' }}
|
||||||
run: |
|
run: |
|
||||||
flutter build windows --release
|
flutter build windows --release
|
||||||
powershell -Command "Compress-Archive -Path build/windows/x64/runner/Release/* -DestinationPath app-windows-x64.zip"
|
powershell -Command "Compress-Archive -Path build/windows/x64/runner/Release/* -DestinationPath app-windows-x64.zip"
|
||||||
|
|
||||||
- name: Upload Windows artifact
|
- name: Upload Windows artifact
|
||||||
if: env.BUILD_WINDOWS == 'true'
|
if: ${{ env.BUILD_WINDOWS == 'true' }}
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: windows-zip
|
name: windows-zip
|
||||||
path: app-windows-x64.zip
|
path: app-windows-x64.zip
|
||||||
|
|
||||||
release-dev:
|
release-dev:
|
||||||
if: github.ref_name == 'dev'
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs:
|
needs:
|
||||||
- meta
|
- meta
|
||||||
- android-build
|
- android-build
|
||||||
- linux-build
|
- linux-build
|
||||||
|
- windows-build
|
||||||
steps:
|
steps:
|
||||||
|
- name: Note branch (dev release)
|
||||||
|
if: ${{ github.ref_name != 'dev' }}
|
||||||
|
run: echo "Not dev branch (${GITHUB_REF_NAME}), release-dev will be skipped."
|
||||||
|
|
||||||
- name: Download Android APK
|
- name: Download Android APK
|
||||||
|
if: ${{ github.ref_name == 'dev' }}
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: android-apk
|
name: android-apk
|
||||||
path: artifacts
|
path: artifacts
|
||||||
|
|
||||||
- name: Download Linux bundle
|
- name: Download Linux bundle
|
||||||
|
if: ${{ github.ref_name == 'dev' }}
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: linux-bundle
|
name: linux-bundle
|
||||||
path: artifacts
|
path: artifacts
|
||||||
|
|
||||||
- name: Download Windows bundle (optional)
|
- name: Download Windows bundle (optional)
|
||||||
if: env.BUILD_WINDOWS == 'true'
|
if: ${{ github.ref_name == 'dev' && env.BUILD_WINDOWS == 'true' }}
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: windows-zip
|
name: windows-zip
|
||||||
path: artifacts
|
path: artifacts
|
||||||
if-no-files-found: ignore
|
|
||||||
|
|
||||||
- name: Prepare artefacts and tag
|
- name: Prepare artefacts and tag
|
||||||
|
if: ${{ github.ref_name == 'dev' }}
|
||||||
id: bundle
|
id: bundle
|
||||||
run: |
|
run: |
|
||||||
BASE="${{ needs.meta.outputs.base_version }}"
|
BASE="${{ needs.meta.outputs.base_version }}"
|
||||||
@@ -214,10 +220,10 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "tag=${TAG}" >> "$GITHUB_OUTPUT"
|
echo "tag=${TAG}" >> "$GITHUB_OUTPUT"
|
||||||
# upload everything in artifacts/
|
|
||||||
echo "files=artifacts/*" >> "$GITHUB_OUTPUT"
|
echo "files=artifacts/*" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
- name: Create prerelease on Gitea
|
- name: Create prerelease on Gitea
|
||||||
|
if: ${{ github.ref_name == 'dev' }}
|
||||||
uses: ncipollo/release-action@v1
|
uses: ncipollo/release-action@v1
|
||||||
with:
|
with:
|
||||||
tag: ${{ steps.bundle.outputs.tag }}
|
tag: ${{ steps.bundle.outputs.tag }}
|
||||||
@@ -227,7 +233,6 @@ jobs:
|
|||||||
artifacts: ${{ steps.bundle.outputs.files }}
|
artifacts: ${{ steps.bundle.outputs.files }}
|
||||||
|
|
||||||
release-master:
|
release-master:
|
||||||
if: github.ref_name == 'master'
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs:
|
needs:
|
||||||
- meta
|
- meta
|
||||||
@@ -235,47 +240,16 @@ jobs:
|
|||||||
- linux-build
|
- linux-build
|
||||||
- windows-build
|
- windows-build
|
||||||
steps:
|
steps:
|
||||||
|
- name: Note branch (master release)
|
||||||
|
if: ${{ github.ref_name != 'master' }}
|
||||||
|
run: echo "Not master branch (${GITHUB_REF_NAME}), release-master will be skipped."
|
||||||
|
|
||||||
- name: Download Android APK
|
- name: Download Android APK
|
||||||
|
if: ${{ github.ref_name == 'master' }}
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: android-apk
|
name: android-apk
|
||||||
path: artifacts
|
path: artifacts
|
||||||
|
|
||||||
- name: Download Linux bundle
|
- name: Download Linux bundle
|
||||||
uses: actions/download-artifact@v3
|
if: ${{ github.ref_name == 'master' }}
|
||||||
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
|
|
||||||
if-no-files-found: ignore
|
|
||||||
|
|
||||||
- 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"
|
|
||||||
# upload everything in artifacts/
|
|
||||||
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 }}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user