diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..2a44a45 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,52 @@ +name: Release + +on: + push: + tags: + - "v*" + +permissions: + contents: write + +jobs: + release: + runs-on: windows-latest + timeout-minutes: 30 + env: + CARGO_TERM_COLOR: always + TAG: ${{ github.ref_name }} + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@v2 + - name: Check tag matches Cargo.toml version + shell: pwsh + run: | + $cargo = (Select-String -Path Cargo.toml -Pattern '^version\s*=\s*"(.+)"' | Select-Object -First 1).Matches[0].Groups[1].Value + $tagVer = $env:TAG.TrimStart('v') + $base = $tagVer.Split('-')[0] + if ($cargo -ne $tagVer -and $cargo -ne $base) { + Write-Error "Tag $env:TAG does not match Cargo.toml version $cargo" + exit 1 + } + - run: cargo test --locked --all-targets + - run: cargo build --release --locked + - name: Package + shell: pwsh + run: | + $name = "snowfall-$env:TAG-windows-x64" + New-Item -ItemType Directory -Path $name | Out-Null + Copy-Item target/release/snowfall.exe $name/ + Copy-Item README.md, LICENSE $name/ + Compress-Archive -Path $name -DestinationPath "$name.zip" + $hash = (Get-FileHash "$name.zip" -Algorithm SHA256).Hash.ToLower() + "$hash $name.zip" | Out-File -Encoding ascii "$name.zip.sha256" + - name: Publish release + shell: pwsh + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + $name = "snowfall-$env:TAG-windows-x64" + $flags = @() + if ($env:TAG -match '-') { $flags += '--prerelease' } + gh release create $env:TAG "$name.zip" "$name.zip.sha256" --generate-notes --title "Snowfall $env:TAG" @flags diff --git a/README.md b/README.md index 27b8dde..1d5c97e 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,12 @@ A lightweight **Windows desktop overlay** that makes snow fall over your screen. - **Mouse interaction:** move the cursor over a pile to plow the snow into a mound (it spills off the window edges), or over falling flakes to push them around. On the taskbar pile the cursor gradually erases snow in a circular area. - Tray icon with a small settings window, global hotkey to quit, low CPU. +## Download + +Get the latest `snowfall-*-windows-x64.zip` from the [Releases](https://github.com/Tomjerri1/Snowfall/releases/latest) page, unzip it and run `snowfall.exe`. No installation needed. + +> Windows SmartScreen may show a warning because the executable is not code-signed. Click **More info → Run anyway**. You can verify the download with the `.sha256` file from the release. + ## Usage | Action | How |