Files
KenanZhu f4d96de79e
Release / Validate Templates (push) Successful in 3m1s
Release / Package & Release (push) Skipped
Release / Update Latest Release Documentation (push) Skipped
chore: refresh docs and adapt workflows for Gitea
2026-10-09 22:02:33 +08:00

122 lines
3.7 KiB
YAML

name: Release
on:
push:
branches: [main]
tags: ['v*']
jobs:
validate:
name: Validate Templates
runs-on: linux-amd64-docker-small
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.25.x'
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Test documentation tracker
run: python -B -m unittest discover -s .github/scripts -p 'test_*.py'
- name: Verify pinned official snapshot
working-directory: tools
run: |
go run . upstream prepare
go run . upstream verify
- name: Test — framework alignment and multilingual notification parity
working-directory: tools
run: go test ./...
- name: Build and render all themes and official languages
working-directory: tools
run: go run . preview all
package:
name: Package & Release
if: startsWith(github.ref, 'refs/tags/v')
needs: validate
runs-on: linux-amd64-docker-small
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITEA_TOKEN }}
- uses: actions/setup-go@v5
with:
go-version: '1.25.x'
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Verify release tag matches the official snapshot
run: |
python -c 'import json, os; lock=json.load(open("gitea.lock.json")); assert lock["tag"] == os.environ["GITHUB_REF_NAME"], "Release tag must match the pinned Gitea tag"'
- name: Verify release notes
run: test -s ".github/release-notes/${GITHUB_REF_NAME}.md"
- name: Update release labels in the archive
run: python -B .github/scripts/track_gitea_release.py --template-release "$TEMPLATE_RELEASE"
env:
TEMPLATE_RELEASE: ${{ github.ref_name }}
- name: Generate static preview for the archive
working-directory: tools
run: go run . preview all
- name: Package generated installable themes and multilingual preview
run: python -B .github/scripts/package_release.py --version "$TEMPLATE_RELEASE"
env:
TEMPLATE_RELEASE: ${{ github.ref_name }}
- name: Create Release
run: python -B .github/scripts/gitea_actions.py publish-release --version "$TEMPLATE_RELEASE"
env:
TEMPLATE_RELEASE: ${{ github.ref_name }}
GITEA_SERVER_URL: ${{ github.server_url }}
GITEA_REPOSITORY: ${{ github.repository }}
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
sync-release-docs:
name: Update Latest Release Documentation
if: startsWith(github.ref, 'refs/tags/v')
needs: package
runs-on: linux-amd64-docker-small
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
ref: main
token: ${{ secrets.GITEA_TOKEN }}
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Update marked release labels on main
run: python -B .github/scripts/track_gitea_release.py --template-release "$TEMPLATE_RELEASE"
env:
TEMPLATE_RELEASE: ${{ github.ref_name }}
- name: Commit documentation update
run: |
git add -- ':(glob)**/*.md'
if git diff --cached --quiet; then
echo "Release labels are already current."
exit 0
fi
git -c user.name='release-bot' -c user.email='release-bot@users.noreply.local' commit -m "docs: mark ${TEMPLATE_RELEASE} as latest release"
git push origin HEAD:main
env:
TEMPLATE_RELEASE: ${{ github.ref_name }}