mirror of
https://github.com/Finesssee/ProxyPilot.git
synced 2026-11-18 18:04:20 +00:00
84 lines
2.3 KiB
YAML
84 lines
2.3 KiB
YAML
name: Build Windows Release
|
|
|
|
on:
|
|
# Only run manually - not on every tag
|
|
workflow_dispatch:
|
|
inputs:
|
|
version:
|
|
description: 'Version (e.g., 0.1.0)'
|
|
required: true
|
|
default: '0.1.0'
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
build-windows:
|
|
runs-on: windows-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: '1.24'
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '22'
|
|
|
|
- name: Build WebUI
|
|
run: |
|
|
cd webui
|
|
npm ci
|
|
npm run build
|
|
|
|
- name: Build Windows binaries
|
|
run: |
|
|
mkdir -p dist
|
|
# Build tray app (includes embedded dashboard)
|
|
go build -ldflags="-s -w -H=windowsgui" -o dist/ProxyPilot.exe ./cmd/proxypilot-tray
|
|
|
|
- name: Install Inno Setup
|
|
run: |
|
|
choco install innosetup -y
|
|
|
|
- name: Generate installer branding images
|
|
run: |
|
|
cd installer/assets
|
|
powershell -ExecutionPolicy Bypass -File generate-wizard-images.ps1
|
|
|
|
- name: Get version
|
|
id: version
|
|
run: |
|
|
if ("${{ github.event.inputs.version }}" -ne "") {
|
|
$version = "${{ github.event.inputs.version }}"
|
|
} else {
|
|
$tag = "${{ github.ref_name }}"
|
|
$version = $tag -replace '^v', ''
|
|
}
|
|
$versionInfo = $version -replace '^v', '' -replace '-dev-0\.', '.' -replace '-dev-', '.'
|
|
echo "VERSION=$version" >> $env:GITHUB_OUTPUT
|
|
echo "VERSION_INFO=$versionInfo" >> $env:GITHUB_OUTPUT
|
|
|
|
- name: Build Inno Setup Installer
|
|
run: |
|
|
& "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" /DAppVersion="${{ steps.version.outputs.VERSION }}" /DVersionInfoVersion="${{ steps.version.outputs.VERSION_INFO }}" installer\proxypilot.iss
|
|
|
|
- name: Upload artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: windows-release
|
|
path: |
|
|
dist/ProxyPilot.exe
|
|
dist/ProxyPilot-*-Setup.exe
|
|
|
|
- name: Upload to Release
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
uses: softprops/action-gh-release@v1
|
|
with:
|
|
files: |
|
|
dist/ProxyPilot.exe
|
|
dist/ProxyPilot-${{ steps.version.outputs.VERSION }}-Setup.exe
|