Files
LM-Gambit/.gitea/workflows/release.yml
T
Netherwarlord 949e8971d5
tests / python (3.10) (push) Failing after 7s
tests / python (3.11) (push) Successful in 14s
tests / web (push) Successful in 41s
tests-macos / macos (push) Canceled after 0s
feat: add macOS testing workflow for comprehensive CI coverage
2026-07-29 05:48:57 -04:00

72 lines
2.7 KiB
YAML

name: release
on:
push:
tags: ["v*"]
workflow_dispatch:
jobs:
release:
# One Linux runner produces all three archives. build.py normalises
# everything that would otherwise vary by build host — file modes, tar
# ownership, and launcher line endings — so a Windows zip built here is
# equivalent to one built on Windows. That removes the three-runner matrix,
# the artifact hand-off between jobs, and the race of three jobs trying to
# create the same release.
#
# Multi-OS runners would still earn their keep for *testing*, which is a
# different question from building.
runs-on: ubuntu-latest
steps:
# build.py copies only what "git ls-files" reports, so it needs real
# history rather than a tarball export.
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "22"
- uses: actions/setup-python@v5
with:
python-version: "3.11"
# No pip install: build.py and publish_gitea.py are both stdlib-only, so
# the release path cannot be broken by a dependency it does not ship.
- name: Build all three archives
run: python packaging/build.py --platform all
# Tag pushes publish; a manual run stops after the build above. Guarding
# the step rather than the job is what keeps workflow_dispatch usable as
# a dry run — the archives still get built and the logs still show their
# sizes, without a release being created.
- name: Publish to Gitea
if: startsWith(github.ref, 'refs/tags/v')
env:
GITEA_URL: ${{ github.server_url }}
GITEA_REPOSITORY: ${{ github.repository }}
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
# Leaves a draft. Review the archives, then publish from the web UI, or
# add --publish here once you trust the pipeline.
run: >-
python packaging/publish_gitea.py
--tag "${{ github.ref_name }}"
dist/LM-Gambit-*.zip dist/LM-Gambit-*.tar.gz
# Without this the dry run is only half a test: the archives are built,
# listed, and then destroyed with the job container, so nobody can open
# one. On a tag the archives reach the release instead, which is why this
# is scoped to the tagless path.
- name: Upload archives for inspection
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
uses: actions/upload-artifact@v4
with:
name: LM-Gambit-archives
path: dist/LM-Gambit-*
if-no-files-found: error
- name: Dry run note
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
run: |
echo "No tag — archives built and uploaded as artifacts, not published."
ls -lh dist/