Add Windows release workflow
This commit is contained in:
1 parent
6048e15996
commit
532ab0234f
4 files changed
+109
-1
No files matched your search
@@ -0,0 +1,94 @@
|
||||
name: Build Windows Release
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
tags:
|
||||
- "v*"
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
concurrency:
|
||||
group: build-windows-release-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
windows-installer:
|
||||
name: Windows installer
|
||||
runs-on: windows-latest
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: pwsh
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: 11.19.0
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22
|
||||
cache: pnpm
|
||||
|
||||
- name: Set up Rust
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
|
||||
- name: Cache Rust dependencies
|
||||
uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
workspaces: |
|
||||
.
|
||||
src-tauri
|
||||
|
||||
- name: Install Windows bundler dependencies
|
||||
run: |
|
||||
choco install nsis wixtoolset -y --no-progress
|
||||
if (Test-Path "C:\Program Files (x86)\NSIS") {
|
||||
Add-Content $env:GITHUB_PATH "C:\Program Files (x86)\NSIS"
|
||||
}
|
||||
if (Test-Path "C:\Program Files (x86)\WiX Toolset v3.14\bin") {
|
||||
Add-Content $env:GITHUB_PATH "C:\Program Files (x86)\WiX Toolset v3.14\bin"
|
||||
}
|
||||
if (Test-Path "C:\Program Files (x86)\WiX Toolset v3.11\bin") {
|
||||
Add-Content $env:GITHUB_PATH "C:\Program Files (x86)\WiX Toolset v3.11\bin"
|
||||
}
|
||||
|
||||
- name: Install frontend dependencies
|
||||
run: pnpm install --frozen-lockfile
|
||||
|
||||
- name: Run Rust tests
|
||||
run: cargo test
|
||||
|
||||
- name: Build Windows desktop installers
|
||||
run: pnpm run desktop:build
|
||||
|
||||
- name: Upload installer artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: clipforge-windows-installers
|
||||
if-no-files-found: error
|
||||
path: |
|
||||
src-tauri/target/release/bundle/msi/*.msi
|
||||
src-tauri/target/release/bundle/nsis/*.exe
|
||||
|
||||
- name: Publish GitHub release assets
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
files: |
|
||||
src-tauri/target/release/bundle/msi/*.msi
|
||||
src-tauri/target/release/bundle/nsis/*.exe
|
||||
Reference in new issue
Block a user