Skip to content

🐧 • v.0.1.0-beta.3 • release #1

🐧 • v.0.1.0-beta.3 • release

🐧 • v.0.1.0-beta.3 • release #1

Workflow file for this run

name: Release
on:
push:
tags:
- "v.*"
permissions:
contents: write
jobs:
build:
name: Build (${{ matrix.name }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: linux
os: ubuntu-latest
artifact-name: FluAutoClicker-linux
binary-path: src-tauri/target/release/fluautoclicker
build-args: --bundles appimage,deb,rpm
- name: windows
os: windows-latest
artifact-name: FluAutoClicker-windows
binary-path: src-tauri/target/release/fluautoclicker.exe
build-args: --no-bundle
steps:
- uses: actions/checkout@v4
- name: Install Linux dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential \
curl \
file \
libappindicator3-dev \
libevdev-dev \
libgtk-3-dev \
libssl-dev \
libwebkit2gtk-4.1-dev \
libx11-dev \
libxdo-dev \
libxi-dev \
libxtst-dev \
librsvg2-dev \
patchelf \
rpm \
wget
- uses: pnpm/action-setup@v4
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
cache-dependency-path: pnpm-lock.yaml
- uses: dtolnay/rust-toolchain@stable
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Typecheck
run: pnpm run typecheck
- name: Static smoke check
run: pnpm run smoke:static
- name: Rust format check
run: cargo fmt --manifest-path src-tauri/Cargo.toml --check
- name: Rust tests
run: cargo test --manifest-path src-tauri/Cargo.toml
- name: Build frontend
run: pnpm run build
- name: Build Tauri app
run: pnpm tauri build ${{ matrix.build-args }}
- name: Upload build output
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact-name }}
if-no-files-found: error
path: |
${{ matrix.binary-path }}
src-tauri/target/release/bundle/**
publish:
name: Publish GitHub Release
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
path: release-downloads
- name: Prepare release body and assets
id: release_meta
shell: pwsh
run: |
$tag = "${{ github.ref_name }}"
$versionTag = $tag
"name=$tag $([char]0x2022) FluAutoClicker [next]" >> $env:GITHUB_OUTPUT
$notesPath = "docs/release-notes/$versionTag.md"
if (-not (Test-Path $notesPath)) {
throw "Release notes file was not found: $notesPath"
}
$changelog = Get-Content $notesPath |
Where-Object { $_ -notmatch '^Release date:\s*' } |
Out-String
$encodedTag = [System.Uri]::EscapeDataString($tag)
$fullChangelogUrl = "https://github.com/Agzes/FluAutoClicker/blob/$encodedTag/$notesPath"
@"
![FluAutoClicker](https://github.com/Agzes/FluAutoClicker/blob/next/docs/readme/fluautoclicker.png)
$changelog
<div align="center">
[Full changelog]($fullChangelogUrl)
</div>
"@ | Set-Content -Path release-body.md -Encoding UTF8
New-Item -ItemType Directory -Force -Path release-assets | Out-Null
Get-ChildItem release-downloads -Recurse -File |
Where-Object {
$_.Name -notmatch '\.(d|rlib|pdb|lib|exp)$' -and
$_.FullName -notmatch '[/\\]\.fingerprint[/\\]'
} |
ForEach-Object {
$targetName = $_.Name
if ($_.Name -eq "fluautoclicker") {
$targetName = "FluAutoClicker-$versionTag-linux-x64"
}
if ($_.Name -eq "fluautoclicker.exe") {
$targetName = "FluAutoClicker-$versionTag-windows-x64.exe"
}
Copy-Item $_.FullName -Destination (Join-Path "release-assets" $targetName)
}
Get-ChildItem release-assets -File |
Sort-Object Name |
ForEach-Object {
$hash = (Get-FileHash $_.FullName -Algorithm SHA256).Hash.ToLowerInvariant()
"$hash $($_.Name)"
} |
Set-Content -Path release-assets/SHA256SUMS.txt -Encoding ASCII
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
name: ${{ steps.release_meta.outputs.name }}
body_path: release-body.md
prerelease: true
files: release-assets/*