Skip to content

ci: configure automated release publishing on tags #6

ci: configure automated release publishing on tags

ci: configure automated release publishing on tags #6

Workflow file for this run

name: Release Build
on:
push:
tags:
- 'v*'
branches:
- main
workflow_dispatch:
permissions:
contents: write
jobs:
build:
name: Build & Release Windows x86_64
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-pc-windows-msvc
- name: Install dependencies
run: npm ci
- name: Build frontend
run: npm run build
- name: Setup runtime binaries
shell: pwsh
run: |
powershell -ExecutionPolicy Bypass -File scripts/setup_binaries.ps1
- name: Build Tauri supervisor release binary
run: |
cd src-tauri
cargo build --release
- name: Package Release
shell: pwsh
run: |
$pkgDir = "./release-pkg"
New-Item -ItemType Directory -Path $pkgDir -Force | Out-Null
Copy-Item src-tauri/target/release/zapret2-supervisor.exe "$pkgDir/zapret2.exe" -Force
Copy-Item -Path ./bin -Destination "$pkgDir/bin" -Recurse -Force
Copy-Item -Path ./lists -Destination "$pkgDir/lists" -Recurse -Force
if (Test-Path "strategies") { Copy-Item -Path ./strategies -Destination "$pkgDir/strategies" -Recurse -Force }
if (Test-Path "configs") { Copy-Item -Path ./configs -Destination "$pkgDir/configs" -Recurse -Force }
# Root helper binaries
if (Test-Path "bin/WinDivert.dll") { Copy-Item "bin/WinDivert.dll" "$pkgDir/" -Force }
if (Test-Path "bin/WinDivert64.sys") { Copy-Item "bin/WinDivert64.sys" "$pkgDir/" -Force }
if (Test-Path "bin/cygwin1.dll") { Copy-Item "bin/cygwin1.dll" "$pkgDir/" -Force }
if (Test-Path "bin/winws2.exe") { Copy-Item "bin/winws2.exe" "$pkgDir/" -Force }
Copy-Item -Path ./README.md -Destination "$pkgDir/" -Force
Copy-Item -Path ./README_EN.md -Destination "$pkgDir/" -Force
Copy-Item -Path ./CONFIG_GUIDE.md -Destination "$pkgDir/" -Force
Copy-Item -Path ./LICENSE -Destination "$pkgDir/" -Force
# Create launch bat
@"
@echo off

Check failure on line 75 in .github/workflows/build.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/build.yml

Invalid workflow file

You have an error in your yaml syntax on line 75
cd /d "%~dp0"
start "" "zapret2.exe"
"@ | Set-Content -Path "$pkgDir/Запустить zapret2.bat" -Encoding ASCII
Compress-Archive -Path "$pkgDir/*" -DestinationPath ./zapret2-v1.0.5.2-windows-x64.zip -CompressionLevel Optimal
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: zapret2-v1.0.5.2-windows-x64
path: ./zapret2-v1.0.5.2-windows-x64.zip
- name: Publish GitHub Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
with:
name: zapret2 Desktop Supervisor & GUI v1.0.5.2
files: ./zapret2-v1.0.5.2-windows-x64.zip
draft: false
prerelease: false
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}