typo #30
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: Sample app release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 | |
| workflow_dispatch: | |
| branches: [ master ] | |
| env: | |
| FLUTTER_VERSION: "3.32.0" | |
| JAVA_VERSION: "17" | |
| FLUTTER_RUST_BRIDGE_VERSION: "1.80.1" | |
| RUST_VERSION: "1.76" | |
| jobs: | |
| build_android: | |
| needs: release | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| shell: bash | |
| # working-directory: ./packages/sample-app | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: actions/setup-java@v3 | |
| with: | |
| distribution: 'zulu' | |
| java-version: ${{ env.JAVA_VERSION }} | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@v1 | |
| with: | |
| toolchain: ${{ env.RUST_VERSION }} | |
| # targets: ${{ matrix.job.target }} | |
| components: "rustfmt" | |
| # - uses: actions-rs/toolchain@v1 | |
| # with: | |
| # toolchain: nightly | |
| # override: true | |
| # target: armv7-linux-androideabi | |
| - uses: subosito/flutter-action@v2 | |
| with: | |
| flutter-version: ${{ env.FLUTTER_VERSION }} | |
| channel: 'stable' | |
| cache: true | |
| cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:' # optional, change this to force refresh cache | |
| cache-path: '${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:' # optional, change this to specify the cache path | |
| architecture: x64 # optional, x64 or arm64 | |
| - name: 🔐 Retrieve base64 keystore and decode it to a file | |
| run: echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 --decode > "${{ github.workspace }}/android-keystore.jks" | |
| - name: 📝🔐 Create key.properties file | |
| env: | |
| KEYSTORE_PROPERTIES_PATH: ${{ github.workspace }}/packages/sample-app/android/key.properties | |
| run: | | |
| cd packages/sample-app | |
| echo 'storeFile=${{ github.workspace }}/packages/sample-app/android-keystore.jks' > $KEYSTORE_PROPERTIES_PATH | |
| echo 'keyAlias=${{ secrets.KEYSTORE_KEY_ALIAS }}' >> $KEYSTORE_PROPERTIES_PATH | |
| echo 'storePassword=${{ secrets.KEYSTORE_PASSWORD }}' >> $KEYSTORE_PROPERTIES_PATH | |
| echo 'keyPassword=${{ secrets.KEYSTORE_KEY_PASSWORD }}' >> $KEYSTORE_PROPERTIES_PATH | |
| - name: pub get | |
| run: | | |
| cd packages/sample-app | |
| flutter pub get | |
| - name: build apk-split | |
| run: | | |
| cd packages/sample-app | |
| flutter build apk --split-per-abi | |
| - name: build apk | |
| run: | | |
| cd packages/sample-app | |
| flutter build apk | |
| # APK | |
| - name: Upload APK to release | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ needs.release.outputs.upload_url }} | |
| asset_path: packages/sample-app/build/app/outputs/flutter-apk/app-release.apk | |
| asset_name: ndk_demo-${{ github.ref_name }}-android-universal.apk | |
| asset_content_type: application/zip | |
| - name: Upload APK to release | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ needs.release.outputs.upload_url }} | |
| asset_path: packages/sample-app/build/app/outputs/flutter-apk/app-arm64-v8a-release.apk | |
| asset_name: ndk_demo-${{ github.ref_name }}-android-arm64-v8a.apk | |
| asset_content_type: application/zip | |
| - name: Upload APK to release | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ needs.release.outputs.upload_url }} | |
| asset_path: packages/sample-app/build/app/outputs/flutter-apk/app-armeabi-v7a-release.apk | |
| asset_name: ndk_demo-${{ github.ref_name }}-android-armeabi-v7a.apk | |
| asset_content_type: application/zip | |
| - name: Upload APK to release | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ needs.release.outputs.upload_url }} | |
| asset_path: packages/sample-app/build/app/outputs/flutter-apk/app-x86_64-release.apk | |
| asset_name: ndk_demo-${{ github.ref_name }}-android-x86_64.apk | |
| asset_content_type: application/zip | |
| # build_linux: | |
| # needs: release | |
| # runs-on: ubuntu-latest | |
| # steps: | |
| # - uses: actions/checkout@v3 | |
| # - uses: actions/setup-java@v2 | |
| # with: | |
| # distribution: 'zulu' | |
| # java-version: '17' | |
| # cache: 'gradle' | |
| # - uses: subosito/flutter-action@v2 | |
| # with: | |
| # flutter-version: '3.22.3' | |
| # channel: 'stable' | |
| # cache: true | |
| # cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:' # optional, change this to force refresh cache | |
| # cache-path: '${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:' # optional, change this to specify the cache path | |
| # architecture: x64 # optional, x64 or arm64 | |
| # - run: | | |
| # sudo apt-get update -y | |
| # sudo apt-get install -y ninja-build libgtk-3-dev libfuse2 libsecret-1-dev libjsoncpp-dev libsecret-1-0 libsecret-tools | |
| # - run: flutter config --enable-linux-desktop | |
| # - run: flutter pub get | |
| # - run: flutter build linux | |
| # - run: dart pub global activate flutter_distributor | |
| # - run: flutter_distributor package --platform linux --targets deb | |
| # - run: cp dist/*/*.deb ndk_demo-${{ github.ref_name }}-linux-x86_64.deb | |
| # #- run: flutter_distributor package --platform linux --targets appimage | |
| # | |
| # - run: wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage | |
| # - run: chmod +x appimagetool-x86_64.AppImage | |
| # - run: cp -r build/linux/x64/release/bundle/* ndk_demo.AppDir/ | |
| # - run: cp -r assets/imgs/logo/logo-new.png ndk_demo.AppDir/logo.png | |
| # - run: ./appimagetool-x86_64.AppImage ndk_demo.AppDir/ | |
| # # LINUX APPIMAGE | |
| # - name: Upload appImage to release | |
| # id: upload-release-asset-appimage | |
| # uses: actions/upload-release-asset@v1 | |
| # env: | |
| # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # with: | |
| # upload_url: ${{ needs.release.outputs.upload_url }} | |
| # asset_path: ndk_demo-x86_64.AppImage | |
| # asset_name: ndk_demo-${{ github.ref_name }}-linux-x86_64.AppImage | |
| # asset_content_type: application/zip | |
| # # LINUX DEB | |
| # - name: Upload deb to release | |
| # id: upload-release-asset-deb | |
| # uses: actions/upload-release-asset@v1 | |
| # env: | |
| # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # with: | |
| # upload_url: ${{ needs.release.outputs.upload_url }} | |
| # asset_path: ndk_demo-${{ github.ref_name }}-linux-x86_64.deb | |
| # asset_name: ndk_demo-${{ github.ref_name }}-linux-x86_64.deb | |
| # asset_content_type: application/zip | |
| # build_linux: | |
| # runs-on: ubuntu-latest | |
| # steps: | |
| # - uses: actions/checkout@v3 | |
| # - uses: actions/setup-java@v2 | |
| # with: | |
| # distribution: 'zulu' | |
| # java-version: '17' | |
| # cache: 'gradle' | |
| # - uses: subosito/flutter-action@v2 | |
| # with: | |
| # flutter-version: '3.13.0' | |
| # channel: 'stable' | |
| # cache: true | |
| # cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:' # optional, change this to force refresh cache | |
| # cache-path: '${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:' # optional, change this to specify the cache path | |
| # architecture: x64 # optional, x64 or arm64 | |
| # - run: | | |
| # sudo apt-get update -y | |
| # sudo apt-get install -y ninja-build libgtk-3-dev libfuse2 libsecret-1-dev libjsoncpp-dev libsecret-1-0 libsecret-tools | |
| # - run: flutter config --enable-linux-desktop | |
| # - run: flutter pub get | |
| # # - run: flutter test | |
| # - run: flutter build linux | |
| # - run: wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage | |
| # - run: chmod +x appimagetool-x86_64.AppImage | |
| # - run: cp -r build/linux/x64/release/bundle/* ndk_demo.AppDir/ | |
| # - run: cp -r assets/imgs/logo/logo.png ndk_demo.AppDir/ | |
| # - run: ./appimagetool-x86_64.AppImage ndk_demo.AppDir/ | |
| # - name: 'Artifact' | |
| # uses: actions/upload-artifact@v2 | |
| # with: | |
| # name: ndk_demo-x86_64.AppImage | |
| # path: ndk_demo-x86_64.AppImage | |
| # | |
| release: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| id: ${{ steps.create_release.outputs.id }} | |
| steps: | |
| # Create Release | |
| - name: Create Release | |
| id: create_release | |
| uses: actions/create-release@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: ${{ github.ref }} | |
| release_name: Release ${{ github.ref }} | |
| draft: true | |
| prerelease: ${{ contains(github.ref, '-dev') }} | |
| publish-release: | |
| needs: [release,build_android] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: eregon/publish-release@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| release_id: ${{ needs.release.outputs.id }} | |
| # dockerimage: | |
| # name: Push Docker image to Docker Hub | |
| # runs-on: ubuntu-latest | |
| # steps: | |
| # - name: Check out the repo | |
| # uses: actions/checkout@v3 | |
| # | |
| # - name: Log in to Docker Hub | |
| # uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a | |
| # with: | |
| # username: ${{ secrets.DOCKER_USERNAME }} | |
| # password: ${{ secrets.DOCKER_PASSWORD }} | |
| # | |
| # - name: Extract metadata (tags, labels) for Docker | |
| # id: meta | |
| # uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 | |
| # with: | |
| # images: ??? | |
| # | |
| # - name: Build and push Docker image | |
| # uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 | |
| # with: | |
| # context: . | |
| # file: ./Dockerfile | |
| # push: true | |
| # tags: ${{ steps.meta.outputs.tags }} | |
| # labels: ${{ steps.meta.outputs.labels }} | |
| #LINUX -> flutter_distributor package --platform linux --targets appimage |