build fix #16
Workflow file for this run
This file contains 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: | |
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 }} |