Files
SlideWire/.gitea/workflows/ci.yml
T
NilsBriggenandClaude Opus 5.5 21f6dea6a1 Release machinery: metainfo, man page, completions, CI, packaging
- AppStream metainfo (validates), man page, bash/zsh/fish completions.
- scripts/install.sh installs everything into a DESTDIR; the release
  archive (scripts/release-tarball.sh) and both PKGBUILDs use it.
- packaging/aur-release: a slidewire package built from the tag.
- CI moves to .gitea/workflows: works without sudo, installs Rust with
  rustup, checks fmt, clippy, tests, extracted translations, the desktop
  file, metainfo and cargo-deny; tags build and attach the archive.
- deny.toml: licences compatible with GPL-3.0-or-later, crates.io only.
- Cargo metadata, MSRV 1.95, thin LTO and stripped release builds.
- CHANGELOG.md for 1.0.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 20:11:40 +02:00

73 lines
3.2 KiB
YAML

name: CI
on:
push:
branches: [main]
tags: ['v*']
pull_request:
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: System packages
run: |
SUDO=$(command -v sudo || true)
$SUDO apt-get update
$SUDO apt-get install -y --no-install-recommends \
build-essential pkg-config curl ca-certificates python3 git \
libasound2-dev libpulse-dev desktop-file-utils appstream
- name: Rust
run: |
curl -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --component rustfmt,clippy
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
- run: cargo fmt --check
- run: cargo clippy --locked --all-targets -- -D warnings
- run: cargo test --locked
- name: Translations are extracted
run: python3 scripts/i18n-extract.py && git diff --exit-code locales/en.json
- run: desktop-file-validate packaging/dev.briggen.Slidewire.desktop
- name: AppStream metadata
# Older appstream releases don't know every tag; the file is checked locally too.
continue-on-error: true
run: appstreamcli validate --no-net packaging/dev.briggen.Slidewire.metainfo.xml
- name: Dependency licences and advisories
run: |
curl -sSfL https://github.com/EmbarkStudios/cargo-deny/releases/download/0.18.3/cargo-deny-0.18.3-x86_64-unknown-linux-musl.tar.gz \
| tar xz --strip-components=1 -C "$HOME/.cargo/bin" cargo-deny-0.18.3-x86_64-unknown-linux-musl/cargo-deny
cargo deny --locked check
release:
if: startsWith(github.ref, 'refs/tags/v')
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: System packages
run: |
SUDO=$(command -v sudo || true)
$SUDO apt-get update
$SUDO apt-get install -y --no-install-recommends \
build-essential pkg-config curl ca-certificates python3 jq libasound2-dev libpulse-dev
- name: Rust
run: |
curl -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
- name: Build the release archive
run: scripts/release-tarball.sh
- name: Attach to the release
env:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
api="${GITHUB_SERVER_URL}/api/v1/repos/${GITHUB_REPOSITORY}"
tag="${GITHUB_REF_NAME}"
id=$(curl -sf -H "Authorization: token $TOKEN" "$api/releases/tags/$tag" | jq -r .id || true)
if [ -z "$id" ] || [ "$id" = null ]; then
notes=$(python3 -c "import re,sys; t=open('CHANGELOG.md').read(); v=sys.argv[1].lstrip('v'); m=re.search(r'^## \[' + re.escape(v) + r'\][^\n]*\n(.*?)(?=^## \[|^\[)', t, re.S | re.M); print(m.group(1).strip() if m else '')" "$tag")
id=$(jq -n --arg tag "$tag" --arg body "$notes" '{tag_name: $tag, name: $tag, body: $body}' \
| curl -sf -H "Authorization: token $TOKEN" -H "Content-Type: application/json" -d @- "$api/releases" | jq -r .id)
fi
for f in dist/*; do
curl -sf -H "Authorization: token $TOKEN" -F "attachment=@$f" "$api/releases/$id/assets?name=$(basename "$f")" >/dev/null
done