release #2
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: release | |
| on: | |
| push: | |
| tags: | |
| - "*" | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| name: Build all packages | |
| runs-on: ubuntu-latest | |
| env: | |
| GIT_LFS_SKIP_SMUDGE: 1 | |
| steps: | |
| - name: Clone repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y curl xz-utils zip libglu1-mesa unzip | |
| shell: bash | |
| - name: Setup HarmonyOS toolchain | |
| uses: ErBWs/setup-ohos@v1 | |
| with: | |
| version: latest | |
| cache: true | |
| - name: Setup JDK21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: "21" | |
| distribution: "temurin" | |
| - name: Setup Flutter (shared) | |
| run: | | |
| git clone -b oh-3.41.9-release --single-branch https://gitcode.com/CPF-Flutter/flutter_flutter.git $GITHUB_WORKSPACE/flutter | |
| echo "$GITHUB_WORKSPACE/flutter/bin" >> $GITHUB_PATH | |
| echo "$GITHUB_WORKSPACE/flutter/bin/cache/dart-sdk/bin" >> $GITHUB_PATH | |
| shell: bash | |
| - name: Setup Android SDK | |
| uses: android-actions/setup-android@v3 | |
| - name: Install Android SDK components | |
| run: | | |
| sdkmanager "platform-tools" "platforms;android-34" "build-tools;34.0.0" | |
| - name: Get Flutter dependencies | |
| run: flutter pub get | |
| shell: bash | |
| - name: Build HAP | |
| run: | | |
| rm -f ohos/build-profile.json5 | |
| flutter create --platforms ohos . | |
| flutter build hap --no-codesign | |
| shell: bash | |
| continue-on-error: true | |
| - name: Build APK | |
| run: flutter build apk --split-per-abi | |
| shell: bash | |
| continue-on-error: true | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: packages | |
| path: | | |
| ./ohos/entry/build/default/outputs/default/entry-default-unsigned.hap | |
| ./build/app/outputs/flutter-apk/*.apk | |
| retention-days: 7 | |
| release: | |
| name: Create Release | |
| needs: build | |
| # if: github.ref_type == 'tag' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Download artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: packages | |
| path: packages | |
| - name: Create release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| name: ${{ github.ref_name }} | |
| draft: true | |
| files: packages/* |