Windows 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: Windows Release | |
| on: | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| env: | |
| CARGO_TERM_COLOR: always | |
| FLUTTER_VERSION: '3.38.0' | |
| jobs: | |
| build-windows: | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Setup Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| flutter-version: ${{ env.FLUTTER_VERSION }} | |
| channel: stable | |
| - name: Cache Cargo | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| shared-key: rust-windows-release | |
| - name: Install flutter_rust_bridge_codegen | |
| run: cargo install flutter_rust_bridge_codegen | |
| - name: Get Flutter dependencies | |
| working-directory: packages/fula_client | |
| run: flutter pub get | |
| - name: Generate Rust bindings | |
| run: flutter_rust_bridge_codegen generate | |
| - name: Build Windows DLL | |
| run: cargo build -p fula-flutter --release | |
| - name: Upload Windows DLL artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: windows-x86_64 | |
| path: target/release/fula_flutter.dll | |
| retention-days: 1 | |
| attach-to-release: | |
| needs: build-windows | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Determine release tag | |
| id: tag | |
| run: | | |
| if [ "${{ github.event_name }}" = "release" ]; then | |
| echo "tag=${{ github.event.release.tag_name }}" >> $GITHUB_OUTPUT | |
| else | |
| TAG=$(gh api repos/${{ github.repository }}/releases/latest --jq .tag_name) | |
| echo "tag=$TAG" >> $GITHUB_OUTPUT | |
| fi | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Download Windows DLL artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: windows-x86_64 | |
| path: windows-libs/ | |
| - name: Package Windows libs | |
| run: cd windows-libs && zip -r ../windows-libs.zip . | |
| - name: Upload to GitHub Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| tag_name: ${{ steps.tag.outputs.tag }} | |
| files: windows-libs.zip | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |