fix: Use GITHUB_WORKSPACE for Windows build artifact path #3
Workflow file for this run
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: | |
| push: | |
| tags: | |
| - 'v[0-9]+.[0-9]+.[0-9]+' | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-android: | |
| name: Build Android APK | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| - name: Setup Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| flutter-version: '3.29.0' | |
| channel: 'stable' | |
| cache: true | |
| - name: Get dependencies | |
| run: flutter pub get | |
| - name: Analyze code | |
| run: flutter analyze | |
| - name: Run tests | |
| run: flutter test | |
| - name: Build APK | |
| run: flutter build apk --release | |
| - name: Upload APK artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: release-apk | |
| path: build/app/outputs/flutter-apk/app-release.apk | |
| build-macos: | |
| name: Build macOS App | |
| runs-on: macos-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| flutter-version: '3.29.0' | |
| channel: 'stable' | |
| cache: true | |
| - name: Get dependencies | |
| run: flutter pub get | |
| - name: Build macOS | |
| run: flutter build macos --release | |
| - name: Create DMG | |
| run: | | |
| brew install create-dmg | |
| create-dmg \ | |
| --volname "Bassdrive Radio" \ | |
| --window-pos 200 120 \ | |
| --window-size 800 400 \ | |
| --icon-size 100 \ | |
| --app-drop-link 600 185 \ | |
| "Bassdrive-Radio-macOS.dmg" \ | |
| "build/macos/Build/Products/Release/bassdrive_radio.app" | |
| - name: Upload macOS artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: release-macos | |
| path: Bassdrive-Radio-macOS.dmg | |
| build-windows: | |
| name: Build Windows App | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| flutter-version: '3.29.0' | |
| channel: 'stable' | |
| cache: true | |
| - name: Get dependencies | |
| run: flutter pub get | |
| - name: Build Windows | |
| run: flutter build windows --release | |
| - name: Create ZIP archive | |
| run: | | |
| cd build/windows/x64/runner/Release | |
| 7z a -tzip $GITHUB_WORKSPACE/Bassdrive-Radio-Windows.zip * | |
| - name: Upload Windows artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: release-windows | |
| path: Bassdrive-Radio-Windows.zip | |
| create-release: | |
| name: Create GitHub Release | |
| needs: [build-android, build-macos, build-windows] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download Android artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: release-apk | |
| path: ./artifacts/ | |
| - name: Download macOS artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: release-macos | |
| path: ./artifacts/ | |
| - name: Download Windows artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: release-windows | |
| path: ./artifacts/ | |
| - name: List artifacts | |
| run: ls -la ./artifacts/ | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: | | |
| ./artifacts/app-release.apk | |
| ./artifacts/Bassdrive-Radio-macOS.dmg | |
| ./artifacts/Bassdrive-Radio-Windows.zip | |
| name: Release ${{ github.ref_name }} | |
| draft: false | |
| prerelease: false | |
| generate_release_notes: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |