Build Android and Windows packages and promote Gitea releases
This commit is contained in:
1 parent
27e77fff39
commit
0f6097f58f
6 files changed
+257
-29
No files matched your search
@@ -0,0 +1,61 @@
|
||||
name: Gitea CI
|
||||
on:
|
||||
pull_request:
|
||||
branches: [main]
|
||||
push:
|
||||
branches: [main]
|
||||
workflow_dispatch:
|
||||
defaults:
|
||||
run:
|
||||
shell: pwsh
|
||||
concurrency:
|
||||
group: app-${{ gitea.ref }}
|
||||
cancel-in-progress: true
|
||||
env:
|
||||
PYTHONUTF8: '1'
|
||||
GIT_CONFIG_COUNT: '2'
|
||||
GIT_CONFIG_KEY_0: core.autocrlf
|
||||
GIT_CONFIG_VALUE_0: 'false'
|
||||
GIT_CONFIG_KEY_1: core.eol
|
||||
GIT_CONFIG_VALUE_1: lf
|
||||
jobs:
|
||||
build:
|
||||
name: Windows x64 and Android
|
||||
runs-on: cutdex-windows-x64
|
||||
env:
|
||||
GITEA_ACTOR: lingjhf
|
||||
CUTDEX_GITEA_TOKEN: ${{ secrets.CUTDEX_GITEA_TOKEN }}
|
||||
steps:
|
||||
- uses: https://github.com/actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Verify toolchains
|
||||
run: |
|
||||
$version = flutter --version --machine | ConvertFrom-Json
|
||||
if ($version.frameworkVersion -ne '3.47.5') { throw 'Flutter 3.47.5 required.' }
|
||||
flutter config --jdk-dir=$env:JAVA_HOME
|
||||
if ($LASTEXITCODE -ne 0) { throw 'Flutter JDK setup failed.' }
|
||||
- run: flutter pub get --enforce-lockfile
|
||||
- run: dart analyze --fatal-infos
|
||||
- run: flutter test --reporter expanded
|
||||
- run: flutter build apk --release --flavor production --target-platform android-arm64,android-x64
|
||||
- run: flutter build windows --release --flavor production
|
||||
- name: Package application
|
||||
run: python tool/gitea/package-app.py
|
||||
- name: Upload Android and Windows packages
|
||||
uses: https://github.com/actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
|
||||
with:
|
||||
name: cutdex-release-packages
|
||||
path: dist/*
|
||||
if-no-files-found: error
|
||||
retention-days: 30
|
||||
checks:
|
||||
name: Gitea CI passed
|
||||
if: always()
|
||||
needs: build
|
||||
runs-on: cutdex-windows-x64
|
||||
steps:
|
||||
- env:
|
||||
RESULT: ${{ needs.build.result }}
|
||||
run: |
|
||||
if ($env:RESULT -ne 'success') { throw "App build: $env:RESULT" }
|
||||
@@ -0,0 +1,32 @@
|
||||
name: Gitea Release
|
||||
on:
|
||||
push:
|
||||
tags: ['v*']
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag:
|
||||
description: Existing release tag matching pubspec version
|
||||
required: true
|
||||
permissions:
|
||||
contents: write
|
||||
concurrency:
|
||||
group: cutdex-release
|
||||
cancel-in-progress: false
|
||||
jobs:
|
||||
release:
|
||||
runs-on: cutdex-windows-x64
|
||||
steps:
|
||||
- uses: https://github.com/actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
||||
with:
|
||||
ref: ${{ gitea.event.inputs.tag || gitea.ref_name }}
|
||||
persist-credentials: false
|
||||
- name: Publish validated Android and Windows packages
|
||||
shell: pwsh
|
||||
env:
|
||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||
GITEA_REPOSITORY: ${{ gitea.repository }}
|
||||
RELEASE_TAG: ${{ gitea.event.inputs.tag || gitea.ref_name }}
|
||||
run: |
|
||||
$env:GITEA_SHA = git rev-parse HEAD
|
||||
python tool/gitea/promote-release.py
|
||||
if ($LASTEXITCODE -ne 0) { throw 'Release promotion failed.' }
|
||||
Reference in new issue
Block a user