因为需要打包 apk,在此之前一直是在本地签名打包的。后来和别人交流了一下,想起来可以用 Github Action 构建持续化集成,自动打包。然后就研究了一下,最后完成了根据 tag 版本自动生成 apk 的 workflows。 ❞ Workflows 自动化构建脚本如下: # main.yml # 自动构建 Apk name: Test, Build and Release apk # ...
- run: flutter test # 打包 APK - run: flutter build apk --release # 发布到 Release - name: Release apk uses: ncipollo/release-action@v1.5.0 with: artifacts: "build/app/outputs/apk/release/*.apk" token: ${{ secrets.GITHUB_RElEASE_TOKEN }} 创建Token 要把构建出来的 apk 发布到仓库的...
target-platform=android-arm64--no-shrink-name:UploadAPKuses:actions/upload-artifact@v2with:name:apkpath:build/app/outputs/apk/release/app-release.apkrelease:name:ReleaseAPKneeds:apkif:startsWith(github.ref,'refs/tags/')runs-on:ubuntu-lateststeps:-name:DownloadAPKfrom builduses:actions/download-art...
-run:flutter build apk --release --target-platform=android-arm64 --no-shrink -name:Upload APK uses:actions/upload-artifact@v2 with: name:apk path:build/app/outputs/apk/release/app-release.apk release: name:Release APK needs:apk if:startsWith(github.ref,'refs/tags/') runs-on:ubuntu-lates...
Flutter makes it easy and fast to build beautiful apps for mobile and beyond flutter.dev Topics androidwindowsmacosdartiosmobilewebmaterial-designcross-platformdesktopweb-frameworkapp-frameworkflutterskialinux-desktopfuchsiamobile-developmentdart-platformflutter-package ...
- name: Build Android App Bundle run: flutter build apk --release -t lib/main_prd.dart - name: Create Release uses: ncipollo/release-action@v1.12.0 with: artifacts: "build/app/outputs/apk/release/app-release.apk" token: ${{ secrets.GITHUB_TOKEN }} generateReleaseNotes: true 0 lib...
build_deploy.yaml文件: name:build_and_deploy on:pull_request:types:[opened,synchronize,reopened,ready_for_review,closed]workflow_dispatch:jobs:job_check:name:Testruns-on:ubuntu-latestif:${{github.event.action!='closed'}}steps:-name:CheckoutCodeuses:actions/checkout@v3-name:SetupFlutteruses:sub...
Download APK from builduses:actions/download-artifact@v2with:name:apk-name:Display structure of downloaded filesrun:ls-R-name:Create Releaseid:create_releaseuses:actions/create-release@v1.1.4env:GITHUB_TOKEN:${{secrets.GITHUB_TOKEN}}with:tag_name:${{github.ref}}release_name:${{github.ref}}-...
这样在打包后Flutter的SO库就会打到APK的lib/armeabi目录中。在运行时如果设备不支持armeabi-v7a可能会崩溃,所以我们需要主动识别并屏蔽掉这类设备,在Android上判断设备是否支持armeabi-v7a也很简单: publicstaticbooleanisARMv7Compatible(){try{if(SDK_INT >= LOLLIPOP) {for(String abi : Build.SUPPORTED_32_BIT...
在.github/workflows文件夹下创建一个名为build_ios.yml的 YAML 配置文件,并添加以下内容: name:Build and Deploy iOSon:push:branches:-mainjobs:build:runs-on:macos-lateststeps:-name:Checkout codeuses:actions/checkout@v2-name:Setup Flutteruses:subosito/flutter-action@v2with:flutter-version:'2.5.2'...