Build and Release #1
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: Build and Release | |
| on: | |
| # Trigger on version tags | |
| push: | |
| tags: | |
| - 'v*.*.*' | |
| # Allow manual trigger | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Version number (e.g., 1.0.5)' | |
| required: true | |
| default: '1.0.5' | |
| jobs: | |
| build-android: | |
| name: Build Android APK/AAB | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'zulu' | |
| java-version: '17' | |
| - name: Setup Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| flutter-version: '3.27.x' | |
| channel: 'stable' | |
| - name: Get dependencies | |
| run: flutter pub get | |
| - name: Generate localizations | |
| run: flutter gen-l10n | |
| - name: Build APK | |
| run: flutter build apk --release --split-per-abi | |
| - name: Build App Bundle | |
| run: flutter build appbundle --release | |
| - name: Upload APK artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: android-apk | |
| path: | | |
| build/app/outputs/flutter-apk/app-armeabi-v7a-release.apk | |
| build/app/outputs/flutter-apk/app-arm64-v8a-release.apk | |
| build/app/outputs/flutter-apk/app-x86_64-release.apk | |
| - name: Upload AAB artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: android-aab | |
| path: build/app/outputs/bundle/release/app-release.aab | |
| build-windows: | |
| name: Build Windows | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| flutter-version: '3.27.x' | |
| channel: 'stable' | |
| - name: Get dependencies | |
| run: flutter pub get | |
| - name: Generate localizations | |
| run: flutter gen-l10n | |
| - name: Build Windows | |
| run: flutter build windows --release | |
| - name: Package Windows Build | |
| run: | | |
| cd build/windows/x64/runner/Release | |
| Compress-Archive -Path * -DestinationPath ../../../../../musly-windows-x64.zip | |
| - name: Upload Windows artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: windows-build | |
| path: musly-windows-x64.zip | |
| build-linux: | |
| name: Build Linux | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| clang cmake ninja-build pkg-config \ | |
| libgtk-3-dev liblzma-dev \ | |
| libmpv-dev mpv | |
| - name: Setup Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| flutter-version: '3.27.x' | |
| channel: 'stable' | |
| - name: Get dependencies | |
| run: flutter pub get | |
| - name: Generate localizations | |
| run: flutter gen-l10n | |
| - name: Build Linux | |
| run: flutter build linux --release | |
| - name: Package Linux Build | |
| run: | | |
| cd build/linux/x64/release/bundle | |
| tar -czf ../../../../../musly-linux-x64.tar.gz * | |
| - name: Upload Linux artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: linux-build | |
| path: musly-linux-x64.tar.gz | |
| create-release: | |
| name: Create GitHub Release | |
| needs: [build-android, build-windows, build-linux] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| - name: Get version | |
| id: version | |
| run: | | |
| if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then | |
| echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT | |
| else | |
| echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| tag_name: v${{ steps.version.outputs.VERSION }} | |
| name: Release v${{ steps.version.outputs.VERSION }} | |
| body: | | |
| ## 🎉 Musly v${{ steps.version.outputs.VERSION }} | |
| ### 📦 Downloads | |
| **Android:** | |
| - ARM64: `app-arm64-v8a-release.apk` (recommended for most devices) | |
| - ARMv7: `app-armeabi-v7a-release.apk` (for older devices) | |
| - x86_64: `app-x86_64-release.apk` (for emulators) | |
| - App Bundle: `app-release.aab` (for Play Store) | |
| **Windows:** | |
| - `musly-windows-x64.zip` (extract and run Musly.exe) | |
| **Linux:** | |
| - `musly-linux-x64.tar.gz` (extract and run musly) | |
| ### 📝 Changelog | |
| See [CHANGELOG.md](https://github.com/dddevid/Musly/blob/main/CHANGELOG.md) | |
| ### 🌍 Translations | |
| Contribute translations at [Crowdin](https://crowdin.com/project/musly) | |
| draft: false | |
| prerelease: false | |
| files: | | |
| artifacts/android-apk/*.apk | |
| artifacts/android-aab/*.aab | |
| artifacts/windows-build/*.zip | |
| artifacts/linux-build/*.tar.gz | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |