feat: 完善文档,新增搜索历史,修复单曲循环时偶现暂停的问题 #6
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: 构建 Android 应用 | |
on: | |
push: | |
tags: | |
- 'v*' | |
# workflow_dispatch: | |
# inputs: | |
# tag: | |
# description: 'Version tag' | |
# required: true | |
# default: 'v0.0.1' | |
jobs: | |
main: | |
name: Release Android App | |
runs-on: ubuntu-latest | |
steps: | |
- name: 克隆仓库 | |
uses: actions/checkout@v4 | |
- name: 对比 Tag 和 pubspec.yaml 的 version, 确保一致 | |
run: | | |
TAG=${GITHUB_REF#refs/tags/} | |
tag_version=$(echo "$TAG" | sed 's/^v//') | |
echo "$tag_version" | |
pubspec_version=$(grep version pubspec.yaml | head -n 1 | cut -d ':' -f 2 | tr -d '[:space:]') | |
echo "$pubspec_version" | |
if [ "$tag_version" = "$pubspec_version" ]; then | |
echo "版本号一致" | |
else | |
echo "版本号不一致!请检查!" | |
exit 1 | |
fi | |
- name: 设置 Java 环境 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: zulu | |
java-version: 17 | |
- name: 安装 Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: 3.22.2 | |
channel: stable | |
cache: true | |
- run: flutter build apk --split-per-abi | |
- name: 推送到 release | |
uses: softprops/action-gh-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
files: ./build/app/outputs/flutter-apk/* | |
token: ${{ secrets.GITHUB_TOKEN }} |