Skip to content

chore: prepare v0.1.22 release #5

chore: prepare v0.1.22 release

chore: prepare v0.1.22 release #5

Workflow file for this run

name: release
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
on:
push:
tags: ["v*"]
permissions:
contents: write
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo
uses: Swatinem/rust-cache@v2
- name: Verify tag matches Cargo.toml version
shell: pwsh
run: |
$tagVersion = "${{ github.ref_name }}" -replace '^v', ''
$cargoToml = Get-Content Cargo.toml -Raw
if ($cargoToml -notmatch '(?m)^version\s*=\s*"([^"]+)"') {
throw "Could not parse package version from Cargo.toml"
}
$cargoVersion = $Matches[1]
if ($cargoVersion -ne $tagVersion) {
throw "Tag version '$tagVersion' does not match Cargo.toml version '$cargoVersion'"
}
- name: Build release
run: cargo build --release --locked
- name: Package portable zip
shell: pwsh
run: |
$tag = "${{ github.ref_name }}"
$dir = "panopticon-$tag-x86_64-pc-windows-msvc"
New-Item -ItemType Directory -Path $dir | Out-Null
Copy-Item target/release/panopticon.exe $dir/
Copy-Item README.md $dir/
Copy-Item LICENSE $dir/
Compress-Archive -Path $dir -DestinationPath "$dir.zip"
- name: Install Inno Setup
shell: pwsh
run: choco install innosetup --yes --no-progress
- name: Build installer
shell: pwsh
run: |
$tag = "${{ github.ref_name }}"
$version = $tag -replace '^v', ''
$iscc = "C:\Program Files (x86)\Inno Setup 6\ISCC.exe"
New-Item -ItemType Directory -Path dist -Force | Out-Null
& $iscc /DAppVersion="$version" installer\panopticon.iss
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
Move-Item "dist\panopticon-$version-setup.exe" "panopticon-$tag-setup.exe"
- name: Create GitHub release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: |
panopticon-*-x86_64-pc-windows-msvc.zip
panopticon-*-setup.exe