32f7c53a7f
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.
44 lines
1.1 KiB
YAML
44 lines
1.1 KiB
YAML
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 }}
|