-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (68 loc) · 2.17 KB
/
windows-release.yml
File metadata and controls
83 lines (68 loc) · 2.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
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 }}