Release assets are now the programs themselves: SolveCraft and solvecraft-cli .exe for Windows,
plain Linux binaries plus the AppImage, a macOS .dmg (SolveCraft.app with an Applications link) and
the universal CLI binary; only the web app stays a zip. The notes template takes {tag}, says to
chmod +x on Linux and macOS, and GitHub adds the change list.
Since no LICENSE or NOTICE file rides along any more, the programs carry them:
THIRD-PARTY-LICENSES.txt (written by `cargo xtask licences` from cargo metadata and each shipped
crate's own licence files, 419 crates; `cargo xtask ci` checks it is current) is embedded with
LICENSE-MIT, LICENSE-APACHE and NOTICE in solvecraft_engine::licences, shown in Help ▸ About ▸
Licences (third-party text laid out by visible rows) and printed by `solvecraft-cli licences`.
Scenario s44_about_licences.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
142 lines
4.8 KiB
YAML
142 lines
4.8 KiB
YAML
# Release builds: push a tag `v*` (or run it by hand with a tag name) and this builds the desktop
|
|
# app and the CLI for Linux, Windows and macOS plus the web app, and attaches them to a GitHub
|
|
# release with SHA256SUMS (a pre-release when the tag has a suffix, such as v0.2.0-rc1). Every
|
|
# download is a plain program (Windows .exe, Linux binary and AppImage, a macOS .dmg); the licences
|
|
# are built into the programs (Help ▸ About ▸ Licences, `solvecraft-cli licences`). Only the web
|
|
# app, being many files, is a zip. Notes: .github/release-notes.md, with {tag} replaced.
|
|
name: Release
|
|
|
|
on:
|
|
push:
|
|
tags: ["v*"]
|
|
workflow_dispatch:
|
|
inputs:
|
|
tag:
|
|
description: "Tag to release (must exist), e.g. v0.1.0"
|
|
required: true
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
TAG: ${{ inputs.tag || github.ref_name }}
|
|
TRUNK_VERSION: v0.21.14
|
|
|
|
jobs:
|
|
linux:
|
|
runs-on: ubuntu-22.04 # an older glibc, so the binaries run on older distributions
|
|
timeout-minutes: 60
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
ref: ${{ env.TAG }}
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
- uses: Swatinem/rust-cache@v2
|
|
- run: cargo build --release --locked -p solvecraft -p solvecraft-cli
|
|
- name: Package
|
|
run: .github/release/package-linux.sh "$TAG"
|
|
- uses: actions/upload-artifact@v4
|
|
with:
|
|
name: linux
|
|
path: out/*
|
|
|
|
windows:
|
|
runs-on: windows-latest
|
|
timeout-minutes: 60
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
ref: ${{ env.TAG }}
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
- uses: Swatinem/rust-cache@v2
|
|
- run: cargo build --release --locked -p solvecraft -p solvecraft-cli
|
|
- name: Package
|
|
shell: pwsh
|
|
run: |
|
|
New-Item -ItemType Directory -Force -Path out | Out-Null
|
|
Copy-Item target/release/solvecraft.exe "out/SolveCraft-$env:TAG-windows-x86_64.exe"
|
|
Copy-Item target/release/solvecraft-cli.exe "out/solvecraft-cli-$env:TAG-windows-x86_64.exe"
|
|
- uses: actions/upload-artifact@v4
|
|
with:
|
|
name: windows
|
|
path: out/*
|
|
|
|
macos:
|
|
# One universal build: arm64 natively, x86_64 cross-compiled on the same runner, joined by lipo.
|
|
runs-on: macos-14
|
|
timeout-minutes: 90
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
ref: ${{ env.TAG }}
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
targets: aarch64-apple-darwin, x86_64-apple-darwin
|
|
- uses: Swatinem/rust-cache@v2
|
|
- run: |
|
|
cargo build --release --locked -p solvecraft -p solvecraft-cli --target aarch64-apple-darwin
|
|
cargo build --release --locked -p solvecraft -p solvecraft-cli --target x86_64-apple-darwin
|
|
- name: Package
|
|
run: .github/release/package-macos.sh "$TAG"
|
|
- uses: actions/upload-artifact@v4
|
|
with:
|
|
name: macos
|
|
path: out/*
|
|
|
|
web:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 60
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
ref: ${{ env.TAG }}
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
targets: wasm32-unknown-unknown
|
|
- uses: Swatinem/rust-cache@v2
|
|
- name: Install trunk
|
|
run: |
|
|
mkdir -p "$HOME/.local/bin"
|
|
curl -sSfL "https://github.com/trunk-rs/trunk/releases/download/${TRUNK_VERSION}/trunk-x86_64-unknown-linux-gnu.tar.gz" | tar -xz -C "$HOME/.local/bin"
|
|
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
|
|
- name: Build (relative public URL, so it can be served from any path)
|
|
working-directory: apps/solvecraft-web
|
|
run: trunk build --release
|
|
- name: Package
|
|
run: |
|
|
name="solvecraft-$TAG-web"
|
|
mkdir -p out && cp -r dist/web "$name"
|
|
cp LICENSE-MIT LICENSE-APACHE NOTICE THIRD-PARTY-LICENSES.txt "$name/"
|
|
zip -qr "out/$name.zip" "$name"
|
|
- uses: actions/upload-artifact@v4
|
|
with:
|
|
name: web
|
|
path: out/*
|
|
|
|
release:
|
|
needs: [linux, windows, macos, web]
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
ref: ${{ env.TAG }}
|
|
- uses: actions/download-artifact@v4
|
|
with:
|
|
path: assets
|
|
merge-multiple: true
|
|
- name: Checksums
|
|
working-directory: assets
|
|
run: sha256sum * > SHA256SUMS && cat SHA256SUMS
|
|
- name: Notes
|
|
run: sed "s/{tag}/$TAG/g" .github/release-notes.md > notes.md
|
|
- uses: softprops/action-gh-release@v2
|
|
with:
|
|
tag_name: ${{ env.TAG }}
|
|
name: SolveCraft ${{ env.TAG }}
|
|
body_path: notes.md
|
|
generate_release_notes: true
|
|
# A tag with a suffix (v0.2.0-rc1) is a pre-release; v1.2.3 is a normal release.
|
|
prerelease: ${{ contains(env.TAG, '-') }}
|
|
files: assets/*
|