-
Notifications
You must be signed in to change notification settings - Fork 2
77 lines (61 loc) · 1.98 KB
/
windows-release.yml
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
name: Windows Release
on:
push:
tags:
- "v*"
workflow_dispatch:
permissions:
contents: write
env:
release_file_name: "release"
jobs:
build:
name: Build and Release Windows EXE
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: "3.27.0"
channel: "stable"
- name: Get dependencies
run: flutter pub get
- name: Enable windows build
run: flutter config --enable-windows-desktop
- name: Build windows
run: flutter build windows --release
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
- name: Build Updater
run: |
cd updater
cargo build --release
- name: Create Release ZIP
run: |
$releaseDir = "release"
New-Item -ItemType Directory -Force -Path $releaseDir
# Copy Flutter build output with folder structure
Copy-Item -Path "build\windows\x64\runner\Release\*" -Destination $releaseDir -Recurse
# Copy updater files
Copy-Item -Path "updater\target\release\updater.exe" -Destination $releaseDir
Copy-Item -Path "updater\updater.bat" -Destination $releaseDir
# Create ZIP file
Compress-Archive -Path "$releaseDir\*" -DestinationPath "${{ env.release_file_name }}-windows.zip"
- name: Upload ZIP
uses: actions/upload-artifact@v4
with:
name: release-exe
path: ${{ env.release_file_name }}-windows.zip
- name: Create Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: ${{ env.release_file_name }}-windows.zip
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}