name: Spotube Release Binary on: workflow_dispatch: inputs: channel: type: choice options: - stable - nightly default: nightly description: The release channel debug: type: boolean default: false description: Debug with SSH toggle required: false dry_run: type: boolean default: false description: Dry run without uploading to release env: FLUTTER_VERSION: 3.28.0-0.1.pre FLUTTER_CHANNEL: master permissions: contents: write jobs: build_platform: strategy: matrix: include: - os: ubuntu-latest platform: linux arch: x86 files: | dist/Spotube-linux-x86_64.deb dist/Spotube-linux-x86_64.rpm dist/spotube-linux-*-x86_64.tar.xz - os: ubuntu-22.04-arm platform: linux arch: arm64 files: | dist/Spotube-linux-aarch64.deb dist/spotube-linux-*-aarch64.tar.xz - os: ubuntu-latest platform: android arch: all files: | build/Spotube-android-all-arch.apk build/Spotube-playstore-all-arch.aab - os: windows-latest platform: windows arch: x86 files: | dist/Spotube-windows-x86_64.nupkg dist/Spotube-windows-x86_64-setup.exe - os: macos-latest platform: ios arch: all files: | Spotube-iOS.ipa - os: macos-14 platform: macos arch: all files: | build/Spotube-macos-universal.dmg build/Spotube-macos-universal.pkg runs-on: ${{matrix.os}} steps: - uses: actions/checkout@v4 - uses: subosito/flutter-action@v2.18.0 with: flutter-version: ${{ env.FLUTTER_VERSION }} channel: ${{ env.FLUTTER_CHANNEL }} cache: true git-source: https://github.com/flutter/flutter.git - name: Setup Java if: ${{matrix.platform == 'android'}} uses: actions/setup-java@v4 with: distribution: 'zulu' java-version: '17' cache: 'gradle' check-latest: true - name: Setup Rust toolchain uses: dtolnay/rust-toolchain@stable with: toolchain: stable - name: Install Xcode if: ${{matrix.platform == 'ios'}} uses: maxim-lobanov/setup-xcode@v1 with: xcode-version: '16.1' - name: Install ${{matrix.platform}} dependencies run: | flutter pub get dart cli/cli.dart install-dependencies --platform=${{matrix.platform}} - name: Sign Apk if: ${{matrix.platform == 'android'}} run: | echo '${{ secrets.KEYSTORE }}' | base64 --decode > android/app/upload-keystore.jks echo '${{ secrets.KEY_PROPERTIES }}' > android/key.properties - name: Build ${{matrix.platform}} binaries run: dart cli/cli.dart build --arch=${{matrix.arch}} ${{matrix.platform}} env: CHANNEL: ${{inputs.channel}} DOTENV: ${{secrets.DOTENV_RELEASE}} - uses: actions/upload-artifact@v4 with: if-no-files-found: error name: ${{matrix.platform}}-${{matrix.arch}} path: ${{matrix.files}} - name: Debug With SSH When fails if: ${{ failure() && inputs.debug && inputs.channel == 'nightly' }} uses: mxschmitt/action-tmate@v3 with: limit-access-to-actor: true upload: runs-on: ubuntu-latest needs: - build_platform steps: - uses: actions/checkout@v4 - uses: actions/download-artifact@v4 with: path: ./Spotube-Release-Binaries - name: Install dependencies run: sudo apt-get install tree -y - name: Generate Checksums run: | tree . md5sum Spotube-Release-Binaries/* >> RELEASE.md5sum sha256sum Spotube-Release-Binaries/* >> RELEASE.sha256sum sed -i 's|Spotube-Release-Binaries/||' RELEASE.sha256sum RELEASE.md5sum - name: Extract pubspec version run: | echo "PUBSPEC_VERSION=$(grep -oP 'version:\s*\K[^+]+(?=\+)' pubspec.yaml)" >> $GITHUB_ENV - uses: actions/upload-artifact@v4 with: if-no-files-found: error name: sums path: | RELEASE.md5sum RELEASE.sha256sum - name: Upload Release Binaries (stable) if: ${{ !inputs.dry_run && inputs.channel == 'stable' }} uses: ncipollo/release-action@v1 with: token: ${{ secrets.GITHUB_TOKEN }} tag: v${{ env.PUBSPEC_VERSION }} # mind the "v" prefix omitBodyDuringUpdate: true omitNameDuringUpdate: true omitPrereleaseDuringUpdate: true allowUpdates: true artifacts: Spotube-Release-Binaries/*,RELEASE.sha256sum,RELEASE.md5sum - name: Upload Release Binaries (nightly) if: ${{ !inputs.dry_run && inputs.channel == 'nightly' }} uses: ncipollo/release-action@v1 with: token: ${{ secrets.GITHUB_TOKEN }} tag: nightly omitBodyDuringUpdate: true omitNameDuringUpdate: true omitPrereleaseDuringUpdate: true allowUpdates: true artifacts: Spotube-Release-Binaries/*,RELEASE.sha256sum,RELEASE.md5sum body: | Build Number: ${{github.run_number}} Nightly release includes newest features but may contain bugs It is preferred to use the stable version unless you know what you're doing - name: Debug With SSH When fails if: ${{ failure() && inputs.debug && inputs.channel == 'nightly' }} uses: mxschmitt/action-tmate@v3 with: limit-access-to-actor: true