Gitea Actions workflow: build the PCM zip, release on v* tags
Build PCM package / build (push) Successful in 8s

Every push to main builds the addon zip + registry metadata as a CI
artifact; pushing a v<version> tag (checked against metadata.json)
creates a release with both attached, matching the download_url
convention build_package.py already writes.
This commit is contained in:
2026-07-15 19:50:43 +07:00
parent cfe6c72f3b
commit 32f7c53a7f
+43
View File
@@ -0,0 +1,43 @@
name: Build PCM package
on:
push:
branches: [main]
tags: ["v*"]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check tag matches metadata.json version
if: startsWith(github.ref, 'refs/tags/v')
run: |
meta=$(python3 -c "import json; print(json.load(open('metadata.json'))['versions'][0]['version'])")
tag="${GITHUB_REF_NAME#v}"
if [ "$meta" != "$tag" ]; then
echo "tag v$tag does not match metadata.json version $meta" >&2
exit 1
fi
- name: Build package
run: python3 tools/build_package.py
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: pcm-package
path: |
dist/*.zip
dist/metadata-registry.json
- name: Create release with the zip attached
if: startsWith(github.ref, 'refs/tags/v')
uses: akkuman/gitea-release-action@v1
with:
files: |
dist/*.zip
dist/metadata-registry.json
token: ${{ secrets.GITEA_TOKEN }}