|
| 1 | +name: Build and Release |
| 2 | + |
| 3 | +on: |
| 4 | + # Trigger on version tags |
| 5 | + push: |
| 6 | + tags: |
| 7 | + - 'v*.*.*' |
| 8 | + |
| 9 | + # Allow manual trigger |
| 10 | + workflow_dispatch: |
| 11 | + inputs: |
| 12 | + version: |
| 13 | + description: 'Version number (e.g., 1.0.5)' |
| 14 | + required: true |
| 15 | + default: '1.0.5' |
| 16 | + |
| 17 | +jobs: |
| 18 | + build-android: |
| 19 | + name: Build Android APK/AAB |
| 20 | + runs-on: ubuntu-latest |
| 21 | + |
| 22 | + steps: |
| 23 | + - name: Checkout code |
| 24 | + uses: actions/checkout@v4 |
| 25 | + |
| 26 | + - name: Setup Java |
| 27 | + uses: actions/setup-java@v4 |
| 28 | + with: |
| 29 | + distribution: 'zulu' |
| 30 | + java-version: '17' |
| 31 | + |
| 32 | + - name: Setup Flutter |
| 33 | + uses: subosito/flutter-action@v2 |
| 34 | + with: |
| 35 | + flutter-version: '3.27.x' |
| 36 | + channel: 'stable' |
| 37 | + |
| 38 | + - name: Get dependencies |
| 39 | + run: flutter pub get |
| 40 | + |
| 41 | + - name: Generate localizations |
| 42 | + run: flutter gen-l10n |
| 43 | + |
| 44 | + - name: Build APK |
| 45 | + run: flutter build apk --release --split-per-abi |
| 46 | + |
| 47 | + - name: Build App Bundle |
| 48 | + run: flutter build appbundle --release |
| 49 | + |
| 50 | + - name: Upload APK artifacts |
| 51 | + uses: actions/upload-artifact@v4 |
| 52 | + with: |
| 53 | + name: android-apk |
| 54 | + path: | |
| 55 | + build/app/outputs/flutter-apk/app-armeabi-v7a-release.apk |
| 56 | + build/app/outputs/flutter-apk/app-arm64-v8a-release.apk |
| 57 | + build/app/outputs/flutter-apk/app-x86_64-release.apk |
| 58 | +
|
| 59 | + - name: Upload AAB artifact |
| 60 | + uses: actions/upload-artifact@v4 |
| 61 | + with: |
| 62 | + name: android-aab |
| 63 | + path: build/app/outputs/bundle/release/app-release.aab |
| 64 | + |
| 65 | + build-windows: |
| 66 | + name: Build Windows |
| 67 | + runs-on: windows-latest |
| 68 | + |
| 69 | + steps: |
| 70 | + - name: Checkout code |
| 71 | + uses: actions/checkout@v4 |
| 72 | + |
| 73 | + - name: Setup Flutter |
| 74 | + uses: subosito/flutter-action@v2 |
| 75 | + with: |
| 76 | + flutter-version: '3.27.x' |
| 77 | + channel: 'stable' |
| 78 | + |
| 79 | + - name: Get dependencies |
| 80 | + run: flutter pub get |
| 81 | + |
| 82 | + - name: Generate localizations |
| 83 | + run: flutter gen-l10n |
| 84 | + |
| 85 | + - name: Build Windows |
| 86 | + run: flutter build windows --release |
| 87 | + |
| 88 | + - name: Package Windows Build |
| 89 | + run: | |
| 90 | + cd build/windows/x64/runner/Release |
| 91 | + Compress-Archive -Path * -DestinationPath ../../../../../musly-windows-x64.zip |
| 92 | +
|
| 93 | + - name: Upload Windows artifact |
| 94 | + uses: actions/upload-artifact@v4 |
| 95 | + with: |
| 96 | + name: windows-build |
| 97 | + path: musly-windows-x64.zip |
| 98 | + |
| 99 | + build-linux: |
| 100 | + name: Build Linux |
| 101 | + runs-on: ubuntu-latest |
| 102 | + |
| 103 | + steps: |
| 104 | + - name: Checkout code |
| 105 | + uses: actions/checkout@v4 |
| 106 | + |
| 107 | + - name: Install dependencies |
| 108 | + run: | |
| 109 | + sudo apt-get update |
| 110 | + sudo apt-get install -y \ |
| 111 | + clang cmake ninja-build pkg-config \ |
| 112 | + libgtk-3-dev liblzma-dev \ |
| 113 | + libmpv-dev mpv |
| 114 | +
|
| 115 | + - name: Setup Flutter |
| 116 | + uses: subosito/flutter-action@v2 |
| 117 | + with: |
| 118 | + flutter-version: '3.27.x' |
| 119 | + channel: 'stable' |
| 120 | + |
| 121 | + - name: Get dependencies |
| 122 | + run: flutter pub get |
| 123 | + |
| 124 | + - name: Generate localizations |
| 125 | + run: flutter gen-l10n |
| 126 | + |
| 127 | + - name: Build Linux |
| 128 | + run: flutter build linux --release |
| 129 | + |
| 130 | + - name: Package Linux Build |
| 131 | + run: | |
| 132 | + cd build/linux/x64/release/bundle |
| 133 | + tar -czf ../../../../../musly-linux-x64.tar.gz * |
| 134 | +
|
| 135 | + - name: Upload Linux artifact |
| 136 | + uses: actions/upload-artifact@v4 |
| 137 | + with: |
| 138 | + name: linux-build |
| 139 | + path: musly-linux-x64.tar.gz |
| 140 | + |
| 141 | + create-release: |
| 142 | + name: Create GitHub Release |
| 143 | + needs: [build-android, build-windows, build-linux] |
| 144 | + runs-on: ubuntu-latest |
| 145 | + permissions: |
| 146 | + contents: write |
| 147 | + |
| 148 | + steps: |
| 149 | + - name: Checkout code |
| 150 | + uses: actions/checkout@v4 |
| 151 | + |
| 152 | + - name: Download all artifacts |
| 153 | + uses: actions/download-artifact@v4 |
| 154 | + with: |
| 155 | + path: artifacts |
| 156 | + |
| 157 | + - name: Get version |
| 158 | + id: version |
| 159 | + run: | |
| 160 | + if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then |
| 161 | + echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT |
| 162 | + else |
| 163 | + echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT |
| 164 | + fi |
| 165 | +
|
| 166 | + - name: Create Release |
| 167 | + uses: softprops/action-gh-release@v1 |
| 168 | + with: |
| 169 | + tag_name: v${{ steps.version.outputs.VERSION }} |
| 170 | + name: Release v${{ steps.version.outputs.VERSION }} |
| 171 | + body: | |
| 172 | + ## 🎉 Musly v${{ steps.version.outputs.VERSION }} |
| 173 | +
|
| 174 | + ### 📦 Downloads |
| 175 | +
|
| 176 | + **Android:** |
| 177 | + - ARM64: `app-arm64-v8a-release.apk` (recommended for most devices) |
| 178 | + - ARMv7: `app-armeabi-v7a-release.apk` (for older devices) |
| 179 | + - x86_64: `app-x86_64-release.apk` (for emulators) |
| 180 | + - App Bundle: `app-release.aab` (for Play Store) |
| 181 | +
|
| 182 | + **Windows:** |
| 183 | + - `musly-windows-x64.zip` (extract and run Musly.exe) |
| 184 | +
|
| 185 | + **Linux:** |
| 186 | + - `musly-linux-x64.tar.gz` (extract and run musly) |
| 187 | +
|
| 188 | + ### 📝 Changelog |
| 189 | + See [CHANGELOG.md](https://github.com/dddevid/Musly/blob/main/CHANGELOG.md) |
| 190 | +
|
| 191 | + ### 🌍 Translations |
| 192 | + Contribute translations at [Crowdin](https://crowdin.com/project/musly) |
| 193 | + draft: false |
| 194 | + prerelease: false |
| 195 | + files: | |
| 196 | + artifacts/android-apk/*.apk |
| 197 | + artifacts/android-aab/*.aab |
| 198 | + artifacts/windows-build/*.zip |
| 199 | + artifacts/linux-build/*.tar.gz |
| 200 | + env: |
| 201 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments