From 32f7c53a7fd182b25e9f20ad0622673cf858a77e Mon Sep 17 00:00:00 2001 From: grabowski Date: Wed, 15 Jul 2026 19:50:43 +0700 Subject: [PATCH] Gitea Actions workflow: build the PCM zip, release on v* tags Every push to main builds the addon zip + registry metadata as a CI artifact; pushing a v tag (checked against metadata.json) creates a release with both attached, matching the download_url convention build_package.py already writes. --- .gitea/workflows/build-pcm.yml | 43 ++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .gitea/workflows/build-pcm.yml diff --git a/.gitea/workflows/build-pcm.yml b/.gitea/workflows/build-pcm.yml new file mode 100644 index 0000000..d17d6e9 --- /dev/null +++ b/.gitea/workflows/build-pcm.yml @@ -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 }}