Release v1.4.0 #17
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*" | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| env: | |
| FLUTTER_CHANNEL: beta | |
| FLUTTER_VERSION: 3.40.0-0.2.pre | |
| jobs: | |
| create_release: | |
| name: Ensure GitHub Release Exists | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Create or update release | |
| uses: ncipollo/release-action@v1 | |
| with: | |
| tag: ${{ github.ref_name }} | |
| name: ${{ github.ref_name }} | |
| allowUpdates: true | |
| draft: false | |
| prerelease: false | |
| generateReleaseNotes: true | |
| build_android: | |
| name: Android APK | |
| runs-on: ubuntu-latest | |
| needs: create_release | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: "17" | |
| - name: Set up Flutter (${{ env.FLUTTER_CHANNEL }}) | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| channel: ${{ env.FLUTTER_CHANNEL }} | |
| flutter-version: ${{ env.FLUTTER_VERSION }} | |
| cache: true | |
| - name: Install dependencies | |
| run: flutter pub get | |
| - name: Build release APK | |
| run: flutter build apk --release | |
| - name: Rename APK with version | |
| run: | | |
| VERSION="${{ github.ref_name }}" | |
| mv build/app/outputs/flutter-apk/app-release.apk "app-release-${VERSION}.apk" | |
| - name: Upload APK to release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: app-release-${{ github.ref_name }}.apk | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| build_macos: | |
| name: macOS App Bundle | |
| runs-on: macos-latest | |
| needs: create_release | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Flutter (${{ env.FLUTTER_CHANNEL }}) | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| channel: ${{ env.FLUTTER_CHANNEL }} | |
| flutter-version: ${{ env.FLUTTER_VERSION }} | |
| cache: true | |
| - name: Install dependencies | |
| run: flutter pub get | |
| - name: Build macOS app | |
| run: flutter build macos --release | |
| - name: Archive macOS app | |
| run: | | |
| APP_DIR="build/macos/Build/Products/Release" | |
| APP_PATH="$(find "$APP_DIR" -maxdepth 1 -name '*.app' -print -quit)" | |
| if [ -z "$APP_PATH" ]; then | |
| echo "No .app found in $APP_DIR" | |
| ls -la "$APP_DIR" | |
| exit 1 | |
| fi | |
| VERSION="${{ github.ref_name }}" | |
| ditto -c -k --sequesterRsrc --keepParent "$APP_PATH" "hr-push-macos-${VERSION}.zip" | |
| - name: Upload macOS zip to release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: hr-push-macos-${{ github.ref_name }}.zip | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| build_windows: | |
| name: Windows ZIP | |
| runs-on: windows-latest | |
| needs: create_release | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Flutter (${{ env.FLUTTER_CHANNEL }}) | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| channel: ${{ env.FLUTTER_CHANNEL }} | |
| flutter-version: ${{ env.FLUTTER_VERSION }} | |
| cache: true | |
| - name: Enable Windows desktop | |
| run: flutter config --enable-windows-desktop | |
| shell: pwsh | |
| - name: Install dependencies | |
| run: flutter pub get | |
| shell: pwsh | |
| - name: Build Windows release | |
| run: flutter build windows --release | |
| shell: pwsh | |
| - name: Archive Windows build | |
| run: | | |
| $env:VERSION="${{ github.ref_name }}" | |
| Compress-Archive -Path "build\windows\x64\runner\Release\*" -DestinationPath "hr-push-windows-$env:VERSION.zip" | |
| shell: pwsh | |
| - name: Upload Windows zip to release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: hr-push-windows-${{ github.ref_name }}.zip | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |