v1.0.3+3 #4
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: Flutter CI | |
# 创建触发打包条件:只要推送tag,就会触发版本打包 | |
on: | |
push: | |
tags: | |
- v* | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
# 设置Android环境 | |
- name: Set up Android SDK | |
uses: actions/setup-java@v1 | |
with: | |
java-version: '12.x' # 设置Java版本 | |
- name: Install Android SDK components | |
run: | | |
mkdir -p ~/android-sdk | |
wget -q "https://dl.google.com/android/repository/commandlinetools-linux-6609375_latest.zip" -O android-sdk.zip | |
unzip -q android-sdk.zip -d ~/android-sdk | |
yes | ~/android-sdk/tools/bin/sdkmanager --sdk_root=$HOME/android-sdk "platform-tools" "platforms;android-31" "build-tools;31.0.0" "extras;google;m2repository" "extras;android;m2repository" | |
# 配置Flutter环境 | |
- name: Set up Flutter | |
uses: subosito/flutter-action@v1 | |
with: | |
channel: 'stable' | |
# 获取Flutter依赖项 | |
- name: Get dependencies | |
run: flutter pub get | |
# 构建APK | |
- name: Build APK | |
run: flutter build apk --release --target-platform android-arm64 | |
# 发布APK | |
- name: Release APK | |
uses: ncipollo/[email protected] | |
with: | |
artifacts: "build/app/outputs/apk/release/*.apk" | |
token: ${{ secrets.GITHUB_TOKEN }} |