release v1.7.16 #35
Workflow file for this run
This file contains hidden or 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: app-build-action | |
| #推送Tag时触发 | |
| on: | |
| workflow_dispatch: # 允许手动触发 | |
| push: | |
| tags: | |
| - "v*" | |
| jobs: | |
| build-android: | |
| runs-on: macos-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| #签出代码 | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: master | |
| #APK签名设置 | |
| - name: Download Android keystore | |
| id: android_keystore | |
| uses: timheuer/[email protected] | |
| with: | |
| fileName: keystore.jks | |
| encodedString: ${{ secrets.KEYSTORE_BASE64 }} | |
| - name: Create key.properties | |
| run: | | |
| echo "storeFile=${{ steps.android_keystore.outputs.filePath }}" > simple_live_app/android/key.properties | |
| echo "storePassword=${{ secrets.STORE_PASSWORD }}" >> simple_live_app/android/key.properties | |
| echo "keyPassword=${{ secrets.KEY_PASSWORD }}" >> simple_live_app/android/key.properties | |
| echo "keyAlias=${{ secrets.KEY_ALIAS }}" >> simple_live_app/android/key.properties | |
| #设置JAVA环境 | |
| - uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'zulu' | |
| java-version: "17" | |
| cache: 'gradle' | |
| #设置Flutter | |
| - name: Flutter action | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| flutter-version: '3.32.0' | |
| cache: true | |
| #更新Flutter的packages | |
| - name: Restore packages | |
| run: | | |
| cd simple_live_app | |
| flutter pub get | |
| #打包APK | |
| - name: Build APK | |
| run: | | |
| cd simple_live_app | |
| flutter build apk --release --split-per-abi | |
| #上传APK至Artifacts | |
| - name: Upload APK to Artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: android | |
| path: | | |
| simple_live_app/build/app/outputs/flutter-apk/app-armeabi-v7a-release.apk | |
| simple_live_app/build/app/outputs/flutter-apk/app-arm64-v8a-release.apk | |
| simple_live_app/build/app/outputs/flutter-apk/app-x86_64-release.apk | |
| #读取版本信息 | |
| - name: Read version | |
| id: version | |
| uses: juliangruber/read-file-action@v1 | |
| with: | |
| path: assets/app_version.json | |
| - name: Echo version | |
| run: echo "${{ fromJson(steps.version.outputs.content).version }}" | |
| - name: Echo version content | |
| run: echo "${{ fromJson(steps.version.outputs.content).version_desc }}" | |
| #上传至Release | |
| - name: Upload Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| name: "${{ fromJson(steps.version.outputs.content).version }}" | |
| body: "${{ fromJson(steps.version.outputs.content).version_desc }}" | |
| prerelease: ${{ fromJson(steps.version.outputs.content).prerelease }} | |
| token: ${{ secrets.TOKEN }} | |
| files: | | |
| simple_live_app/build/app/outputs/flutter-apk/app-x86_64-release.apk | |
| simple_live_app/build/app/outputs/flutter-apk/app-arm64-v8a-release.apk | |
| simple_live_app/build/app/outputs/flutter-apk/app-armeabi-v7a-release.apk | |
| #完成 | |
| - run: echo "🍏 This job's status is ${{ job.status }}." | |
| # 打包Linux | |
| build-linux: | |
| runs-on: ubuntu-22.04 | |
| permissions: | |
| contents: write | |
| steps: | |
| # 签出代码 | |
| - uses: actions/checkout@v4 | |
| with: | |
| # 强制拉取分支master | |
| repository: SlotSun/dart_simple_live | |
| ref: master | |
| fetch-depth: 1 | |
| submodules: false | |
| # 设置Flutter环境 | |
| - name: Setup Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| flutter-version: "3.32.0" | |
| cache: true | |
| # 安装依赖 | |
| - name: Update apt-get | |
| run: sudo apt-get update | |
| - name: Install Dependencies | |
| run: sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev libmpv-dev mpv libasound2-dev | |
| # 打开Linux Desktop支持 | |
| - name: Enable Flutter Desktop | |
| run: flutter config --enable-linux-desktop | |
| # 更新Flutter的packages | |
| - name: Restore Packages | |
| run: | | |
| cd simple_live_app | |
| flutter pub get | |
| # 设置fast-forge环境 | |
| - name: Install fast-forge | |
| run: | | |
| git clone https://github.com/SlotSun/fastforge.git | |
| cd fastforge | |
| dart pub global activate melos | |
| melos run activate | |
| # build Linux ZIP\DMG | |
| - name: Build Linux | |
| run: | | |
| cd simple_live_app | |
| fastforge package --platform linux --targets deb,zip --skip-clean | |
| # 上传Linux包至Artifacts | |
| - name: Upload Linux APP to Artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: linux | |
| path: | | |
| simple_live_app/build/dist/*/*.deb | |
| simple_live_app/build/dist/*/*.zip | |
| # 读取版本信息 | |
| - name: Read version | |
| id: version | |
| uses: juliangruber/read-file-action@v1 | |
| with: | |
| path: assets/app_version.json | |
| - name: Echo version | |
| run: echo "${{ fromJson(steps.version.outputs.content).version }}" | |
| - name: Echo version content | |
| run: echo "${{ fromJson(steps.version.outputs.content).version_desc }}" | |
| #上传至Release | |
| - name: Upload Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| name: "${{ fromJson(steps.version.outputs.content).version }}" | |
| body: "${{ fromJson(steps.version.outputs.content).version_desc }}" | |
| prerelease: ${{ fromJson(steps.version.outputs.content).prerelease }} | |
| token: ${{ secrets.TOKEN }} | |
| files: | | |
| simple_live_app/build/dist/*/*.deb | |
| simple_live_app/build/dist/*/*.zip | |
| #完成 | |
| - run: echo "🍏 Linux job's status is ${{ job.status }}." | |
| # 打包Windows | |
| build-windows: | |
| runs-on: windows-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| # 签出代码 | |
| - uses: actions/checkout@v4 | |
| with: | |
| repository: SlotSun/dart_simple_live | |
| ref: master | |
| fetch-depth: 1 | |
| submodules: false | |
| # 设置Flutter环境 | |
| - name: Setup Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| flutter-version: "3.32.0" | |
| cache: true | |
| channel: "stable" | |
| - name: Enable Flutter Desktop | |
| run: flutter config --enable-windows-desktop | |
| - name: Restore Packages | |
| run: | | |
| cd simple_live_app | |
| flutter pub get | |
| # 设置fast-forge环境 | |
| - name: Install fast-forge | |
| run: | | |
| git clone https://github.com/SlotSun/fastforge.git | |
| cd fastforge | |
| dart pub global activate melos | |
| melos run activate | |
| # build Windows ZIP\MSIX | |
| - name: Build Windows | |
| run: | | |
| cd simple_live_app | |
| fastforge package --platform windows --targets msix,zip --skip-clean | |
| # 上传Windows至Artifacts | |
| - name: Upload Windows APP to Artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: windows | |
| path: | | |
| simple_live_app/build/dist/*/*.msix | |
| simple_live_app/build/dist/*/*.zip | |
| # 读取版本信息 | |
| - name: Read version | |
| id: version | |
| uses: juliangruber/read-file-action@v1 | |
| with: | |
| path: assets/app_version.json | |
| - name: Echo version | |
| run: echo "${{ fromJson(steps.version.outputs.content).version }}" | |
| - name: Echo version content | |
| run: echo "${{ fromJson(steps.version.outputs.content).version_desc }}" | |
| #上传至Release | |
| - name: Upload Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| name: "${{ fromJson(steps.version.outputs.content).version }}" | |
| body: "${{ fromJson(steps.version.outputs.content).version_desc }}" | |
| prerelease: ${{ fromJson(steps.version.outputs.content).prerelease }} | |
| token: ${{ secrets.TOKEN }} | |
| files: | | |
| simple_live_app/build/dist/*/*.msix | |
| simple_live_app/build/dist/*/*.zip | |
| #完成 | |
| - run: echo "🍏 Windows job's status is ${{ job.status }}." |