46ba53631a
release / release (push) Successful in 22s
- install.sh: no-root user-local install (private venv + ~/.local/bin launchers + desktop entry); --ref <tag> to install a specific release, --uninstall to remove; auto-installs the python3-venv prerequisite with consent - packaging/make-run.sh: build a self-extracting .run installer (makeself) bundling the wheel + install.sh; release workflow builds and attaches it - M13 self-update apply: `rigdoctor update` runs an authenticated pip upgrade (rigdoctor[gui] @ git+https://oauth2:<token>@...@<tag>), token scrubbed; GUI sidebar "Update to v…" button applies it and prompts to restart - version 0.0.7, CHANGELOG, docs (M9/M13, ROADMAP, README install section) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
71 lines
2.4 KiB
YAML
71 lines
2.4 KiB
YAML
name: release
|
|
run-name: Release on push to main
|
|
|
|
# Builds a wheel + sdist and publishes a Gitea release v<version> on every push to
|
|
# main. The version comes from pyproject.toml (kept in lockstep with __version__, D19);
|
|
# if a release for that tag already exists, the job is a no-op — so bump the version
|
|
# (and CHANGELOG) to cut a new release.
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.12"
|
|
|
|
- name: Build wheel + sdist
|
|
run: |
|
|
python -m pip install --upgrade build
|
|
python -m build
|
|
|
|
- name: Build self-extracting installer (.run)
|
|
run: |
|
|
(apt-get update && apt-get install -y makeself && sh packaging/make-run.sh) \
|
|
|| echo "makeself unavailable — skipping .run"
|
|
|
|
- name: Read version
|
|
id: ver
|
|
run: |
|
|
V=$(python -c "import tomllib; print(tomllib.load(open('pyproject.toml','rb'))['project']['version'])")
|
|
echo "version=$V" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Publish Gitea release
|
|
env:
|
|
TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: |
|
|
set -euo pipefail
|
|
API="${{ github.server_url }}/api/v1/repos/${{ github.repository }}"
|
|
TAG="v${{ steps.ver.outputs.version }}"
|
|
|
|
code=$(curl -sS -o /tmp/existing.json -w '%{http_code}' \
|
|
-H "Authorization: token ${TOKEN}" "${API}/releases/tags/${TAG}")
|
|
if [ "$code" = "200" ]; then
|
|
echo "Release ${TAG} already exists — nothing to do."
|
|
exit 0
|
|
fi
|
|
|
|
echo "Creating release ${TAG}…"
|
|
rid=$(curl -sS -X POST \
|
|
-H "Authorization: token ${TOKEN}" \
|
|
-H "Content-Type: application/json" \
|
|
-d "{\"tag_name\":\"${TAG}\",\"target_commitish\":\"${{ github.sha }}\",\"name\":\"${TAG}\",\"body\":\"Automated release for ${TAG}. See CHANGELOG.md.\"}" \
|
|
"${API}/releases" | python -c "import sys, json; print(json.load(sys.stdin)['id'])")
|
|
|
|
for f in dist/*; do
|
|
echo "Uploading $(basename "$f")…"
|
|
curl -sS -X POST \
|
|
-H "Authorization: token ${TOKEN}" \
|
|
-F "attachment=@${f}" \
|
|
"${API}/releases/${rid}/assets?name=$(basename "$f")" >/dev/null
|
|
done
|
|
echo "Published ${TAG}."
|