Merge pull request #3 from mIwr/develop #4
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: Linux, Android, Windows release builds | |
| on: | |
| push: | |
| branches: | |
| - master | |
| paths: | |
| - "**/*.dart" | |
| - "**/*.yaml" | |
| - "**/*.yml" | |
| - "**/*.xml" | |
| - "**/*.gradle" | |
| - "**/*.properties" | |
| - ".github/workflows/**" | |
| concurrency: | |
| group: proj-${{ github.head_ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build_linux_app: | |
| name: Build linux release build | |
| runs-on: ubuntu-latest | |
| outputs: | |
| release_ver: ${{ steps.app_proj_version.outputs.version-number }} | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: subosito/flutter-action@v2 | |
| with: | |
| channel: 'stable' | |
| - run: | | |
| sudo apt-get update -y | |
| sudo apt-get install -y ninja-build libgtk-3-dev libsecret-1-dev libjsoncpp-dev libsecret-1-0 | |
| - run: flutter pub get | |
| - run: flutter build linux --release | |
| - name: Read app version | |
| id: app_proj_version | |
| uses: NiklasLehnfeld/flutter-version-number-action@v1 | |
| with: | |
| file-path: pubspec.yaml | |
| - name: Zip build | |
| run: cd build/linux/x64/release/bundle && zip -r pusher_linux_amd64 . | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: uploaded_linux_amd64 | |
| path: build/linux/x64/release/bundle/pusher_linux_amd64.zip | |
| build_android_app: | |
| name: Build android release build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-java@v5 | |
| with: | |
| distribution: temurin | |
| java-version: 17 | |
| - uses: subosito/flutter-action@v2 | |
| with: | |
| channel: 'stable' | |
| - run: flutter pub get | |
| - name: Prepare keychain | |
| run: echo ${{ secrets.KEYCHAIN_ENC }} | base64 --decode >> android/app/keychain.jks | |
| - name: Prepare key properties | |
| run: echo ${{ secrets.KEY_PROPERTIES_ENC }} | base64 --decode >> android/key.properties | |
| - run: flutter build apk --release | |
| - name: Upload signed APK | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: uploaded_apk | |
| path: build/app/outputs/flutter-apk/app-release.apk | |
| build_win_app: | |
| name: Build windows release build | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: subosito/flutter-action@v2 | |
| with: | |
| channel: 'stable' | |
| - run: flutter pub get | |
| - run: flutter build windows --release | |
| - name: Zip build | |
| run: Compress-Archive -Path build/windows/x64/runner/Release -Destination pusher_win_x64.zip | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: uploaded_win_x64 | |
| path: pusher_win_x64.zip | |
| github_release_draft: | |
| name: Make Github release draft | |
| needs: | |
| - build_linux_app | |
| - build_android_app | |
| - build_win_app | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.RELEASE_BUILD_TOKEN }} | |
| RELEASE_VERSION: ${{ needs.build_linux_app.outputs.release_ver }} | |
| outputs: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Create Release | |
| id: create_release | |
| uses: actions/create-release@v1 | |
| with: | |
| tag_name: ${{ env.RELEASE_VERSION }} | |
| release_name: ${{ github.event.repository.name }} ${{ env.RELEASE_VERSION }} | |
| draft: true | |
| github_upload_win64_artifact: | |
| name: Upload Windows x64 build artifact to Github release | |
| needs: | |
| - github_release_draft | |
| - build_linux_app | |
| - build_win_app | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.RELEASE_BUILD_TOKEN }} | |
| RELEASE_VERSION: ${{ needs.build_linux_app.outputs.release_ver }} | |
| UPLOAD_URL: ${{ needs.github_release_draft.outputs.upload_url }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download win artifact | |
| uses: actions/download-artifact@v5 | |
| with: | |
| name: uploaded_win_x64 | |
| - name: Upload win artifact to release assets | |
| uses: actions/upload-release-asset@v1.0.1 | |
| with: | |
| upload_url: ${{ env.UPLOAD_URL }} | |
| asset_path: pusher_win_x64.zip | |
| asset_name: ${{ github.event.repository.name }} ${{ env.RELEASE_VERSION }}-win-x64.zip | |
| asset_content_type: application/zip | |
| github_upload_linux64_artifact: | |
| name: Upload Linux x64 build artifact to Github release | |
| needs: | |
| - github_release_draft | |
| - build_linux_app | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.RELEASE_BUILD_TOKEN }} | |
| RELEASE_VERSION: ${{ needs.build_linux_app.outputs.release_ver }} | |
| UPLOAD_URL: ${{ needs.github_release_draft.outputs.upload_url }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download linux artifact | |
| uses: actions/download-artifact@v5 | |
| with: | |
| name: uploaded_linux_amd64 | |
| - name: Upload linux artifact to release assets | |
| uses: actions/upload-release-asset@v1.0.1 | |
| with: | |
| upload_url: ${{ env.UPLOAD_URL }} | |
| asset_path: pusher_linux_amd64.zip | |
| asset_name: ${{ github.event.repository.name }} ${{ env.RELEASE_VERSION }}-linux-amd64.zip | |
| asset_content_type: application/zip | |
| github_upload_android_artifact: | |
| name: Upload universal Android build artifact to Github release | |
| needs: | |
| - github_release_draft | |
| - build_linux_app | |
| - build_android_app | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.RELEASE_BUILD_TOKEN }} | |
| RELEASE_VERSION: ${{ needs.build_linux_app.outputs.release_ver }} | |
| UPLOAD_URL: ${{ needs.github_release_draft.outputs.upload_url }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download android artifact | |
| uses: actions/download-artifact@v5 | |
| with: | |
| name: uploaded_apk | |
| - name: Upload android artifact to release assets | |
| uses: actions/upload-release-asset@v1.0.1 | |
| with: | |
| upload_url: ${{ env.UPLOAD_URL }} | |
| asset_path: app-release.apk | |
| asset_name: ${{ github.event.repository.name }} ${{ env.RELEASE_VERSION }}-android-universal.apk | |
| asset_content_type: application/zip |