-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5f6fe40
commit 0b4a193
Showing
5 changed files
with
73 additions
and
5 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# main.yml | ||
# 自动构建 Apk | ||
name: Test, Build and Release apk | ||
|
||
# 工作流程触发的时机,这里是当一个版本标签推送到仓库时触发 | ||
on: | ||
push: | ||
tags: | ||
- v* | ||
|
||
# 这个工作流程需要执行的任务 | ||
jobs: | ||
process: | ||
name: all process | ||
runs-on: ubuntu-latest | ||
# 这个任务的步骤 | ||
steps: | ||
# 拉取项目代码 | ||
- uses: actions/checkout@v2 | ||
# 建立 java 环境 | ||
- name: Setup Java JDK | ||
uses: actions/setup-java@v1.4.3 | ||
with: | ||
java-version: "12.x" | ||
# 建立 Flutter 环境 | ||
- name: Flutter action | ||
uses: subosito/flutter-action@v1.4.1 | ||
with: | ||
channel: "stable" | ||
flutter-version: "1.22.4" | ||
# 下载项目依赖 | ||
- run: flutter pub get | ||
- run: echo $ENCODED_KEYSTORE | base64 -di > android/app/keystore.jks | ||
env: | ||
ENCODED_KEYSTORE: ${{ secrets.ENCODED_KEYSTORE }} | ||
# 打包 APK | ||
- run: flutter build apk --release | ||
env: | ||
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} | ||
KEY_ALIAS: ${{ secrets.KEY_ALIAS }} | ||
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD}} | ||
# 发布到 Release | ||
- name: Release apk | ||
uses: ncipollo/release-action@v1.5.0 | ||
with: | ||
artifacts: "build/app/outputs/apk/release/*.apk" | ||
token: ${{ secrets.RELEASE_TOKEN }} |
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
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
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