name: Build Release on: push: tags: - 'v*' 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/cliproxytray - name: Build Installer UI run: | cd installer-ui npm ci npm run build - name: Copy Installer UI to cmd/installer run: | # Ensure target directory exists New-Item -ItemType Directory -Force -Path cmd/installer/ui | Out-Null # Copy built UI files Copy-Item -Path installer-ui/dist/* -Destination cmd/installer/ui/ -Recurse -Force shell: pwsh - name: Create bundle for installer run: | # Create bundle directory New-Item -ItemType Directory -Force -Path cmd/installer/bundle | Out-Null # Copy files for embedding Copy-Item -Path dist/ProxyPilot.exe -Destination cmd/installer/bundle/ Copy-Item -Path config.example.yaml -Destination cmd/installer/bundle/ Copy-Item -Path static/icon.ico -Destination cmd/installer/bundle/ Copy-Item -Path static/icon.png -Destination cmd/installer/bundle/ shell: pwsh - name: Build Custom Installer run: | go build -ldflags="-s -w -H=windowsgui" -o dist/ProxyPilot-Installer.exe ./cmd/installer - 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 "") { echo "VERSION=${{ github.event.inputs.version }}" >> $env:GITHUB_OUTPUT } else { $tag = "${{ github.ref_name }}" $version = $tag -replace '^v', '' echo "VERSION=$version" >> $env:GITHUB_OUTPUT } - name: Build Inno Setup Installer run: | & "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" /DAppVersion="${{ steps.version.outputs.VERSION }}" installer\proxypilot.iss - name: Upload artifacts uses: actions/upload-artifact@v4 with: name: windows-release path: | dist/ProxyPilot.exe dist/ProxyPilot-Installer.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-Installer.exe dist/ProxyPilot-${{ steps.version.outputs.VERSION }}-Setup.exe config.example.yaml