Skip to content

Merge version 3.8.1 to main #10

Merge version 3.8.1 to main

Merge version 3.8.1 to main #10

Workflow file for this run

name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
release:
name: Build and release
runs-on: windows-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24
cache: npm
- uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-pc-windows-msvc
- uses: Swatinem/rust-cache@v2
with:
workspaces: './src-tauri -> target'
- name: Install dependencies
run: npm install
- name: Extract changelog
shell: pwsh
run: |
$version = [regex]::Escape(("${{ github.ref_name }}".TrimStart('v')))
$content = Get-Content CHANGELOG.md -Raw
$pattern = "(?ms)# v$version .*?(?=\n# v|\z)"
$match = [regex]::Match($content, $pattern)
if ($match.Success) {
Set-Content -Path release_body.md -Value $match.Value.Trim()
}
- name: Build
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
with:
tagName: ${{ github.ref_name }}
releaseName: BlurAutoClicker ${{ github.ref_name }}
releaseBody: See CHANGELOG.md for details.
releaseDraft: true
- name: Update release body from changelog
shell: pwsh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if (Test-Path release_body.md) {
gh release edit "${{ github.ref_name }}" --notes-file release_body.md
}
- name: Create portable zip
shell: pwsh
run: |
$exe = Get-ChildItem -Path "src-tauri/target/release" -Filter "BlurAutoClicker.exe" | Select-Object -First 1
if (-not $exe) { Write-Error "BlurAutoClicker.exe not found"; exit 1 }
$tag = "${{ github.ref_name }}"
$zipName = "BlurAutoClicker-${tag}-portable.zip"
Compress-Archive -Path $exe.FullName -DestinationPath $zipName
Add-Content -Path $env:GITHUB_ENV -Value "ZIP_PATH=$zipName"
- name: Upload portable zip to release
shell: pwsh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload "${{ github.ref_name }}" "$env:ZIP_PATH" --clobber