The release workflow runs on a version tag (which must equal the program's version) or by hand, never on an ordinary push. Each system runs the workspace's whole tests, builds its package, signs it only when the owner's secrets exist (and says so in the run's notices when not), and checks it: the .deb and .rpm file lists; the Windows program's PE subsystem is the GUI one, and the installer is run silently, installed over itself, uninstalled, with a sentinel in the data folder that must survive; the dmg is opened (never run) and its app checked for both architectures, the plist, the licences and the signature. A last job gathers the packages, the licences, a latest.json with the version number the app's daily look reads, and SHA256SUMS.txt, into a DRAFT release; a release that is already published is never touched. The apt and dnf repositories are no longer pushed to by a tag: that is the manual publish-repos workflow, from a published release. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
56 lines
2.1 KiB
YAML
56 lines
2.1 KiB
YAML
# Add a PUBLISHED release's .deb and .rpm to the apt and dnf repositories on
|
|
# the gh-pages branch (plan P11a step 3, D-26; GitHub Pages serves them). By
|
|
# hand only, after the release was tried and published: the release workflow
|
|
# never touches these repositories (plan P15 unit C1). Unsigned until the
|
|
# owner's release key signs the indexes (Q-4).
|
|
name: publish-repos
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
tag:
|
|
description: "The published release's tag, e.g. v0.1.0"
|
|
required: true
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
repos:
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Repository tools
|
|
run: sudo apt-get update && sudo apt-get install -y apt-utils createrepo-c
|
|
- name: The release's .deb and .rpm (it must be published, not a draft)
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
TAG: ${{ inputs.tag }}
|
|
run: |
|
|
draft=$(gh release view "$TAG" --json isDraft --jq .isDraft)
|
|
[ "$draft" = false ] || { echo "$TAG is a draft: publish the release first" >&2; exit 1; }
|
|
mkdir assets
|
|
gh release download "$TAG" --dir assets --pattern '*.deb' --pattern '*.rpm'
|
|
ls -l assets
|
|
- name: Add them to the apt and dnf repositories (gh-pages)
|
|
env:
|
|
TAG: ${{ inputs.tag }}
|
|
run: |
|
|
git fetch origin gh-pages || true
|
|
if git rev-parse --verify origin/gh-pages >/dev/null 2>&1; then
|
|
git worktree add repo origin/gh-pages
|
|
else
|
|
git worktree add --detach repo && git -C repo checkout --orphan gh-pages && git -C repo rm -rfq . || true
|
|
fi
|
|
mkdir -p repo/apt/pool repo/dnf
|
|
cp assets/*.deb repo/apt/pool/
|
|
cp assets/*.rpm repo/dnf/
|
|
deploy/packaging/repo-indexes.sh apt repo/apt
|
|
deploy/packaging/repo-indexes.sh dnf repo/dnf
|
|
cd repo || exit 1
|
|
git config user.name "wanderbooks release"
|
|
git config user.email "release@wanderbooks.ai"
|
|
git add -A
|
|
git commit -m "wanderbooks $TAG"
|
|
git push origin HEAD:gh-pages
|