Merge branch 'master' of https://github.com/CodeGather/flutter_ali_auth #12
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release Package | |
# 监听版本号变化 | |
on: | |
push: | |
tags: | |
- 'v[0-9]+.[0-9]+.[0-9]+*' | |
jobs: | |
# Release 操作 | |
release: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
discussions: write | |
steps: | |
# 拉取项目代码 | |
- uses: actions/checkout@v3 | |
# 建立 java 环境 | |
- name: Setup Java JDK | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: '11' | |
# 建立 Flutter 环境 | |
- name: Flutter action | |
uses: subosito/flutter-action@main | |
with: | |
channel: "stable" | |
# 下载项目依赖 | |
- run: flutter pub get | |
# 执行测试 | |
- run: flutter test | |
# 打包 APK | |
- name: Build Release apk | |
run: flutter build apk --release | |
working-directory: example | |
# 发布到 上次文件至artifact | |
- name: Upload Release APK | |
uses: actions/upload-artifact@v3 | |
with: | |
name: app-release.apk | |
path: example/build/app/outputs/apk/release/app-release.apk | |
# 创建 Release | |
- name: Create a Release | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: "example/build/app/outputs/apk/release/*.apk" | |
token: ${{ secrets.ACCOUNT_TOKEN }} | |
allowUpdates: true | |
artifactErrorsFailBuild: true | |
generateReleaseNotes: true | |
bodyFile: "release.md" |