Update build_updatexml.yml
This commit is contained in:
28
.github/workflows/build_updatexml.yml
vendored
28
.github/workflows/build_updatexml.yml
vendored
@@ -14,9 +14,13 @@ on:
|
|||||||
description: "Filename to save the downloaded ZIP as. Required when asset_download_url is provided."
|
description: "Filename to save the downloaded ZIP as. Required when asset_download_url is provided."
|
||||||
required: false
|
required: false
|
||||||
default: ""
|
default: ""
|
||||||
|
release_tag:
|
||||||
|
description: "Release tag to attach dist/updates.xml to (manual runs only). Leave blank to skip attachment."
|
||||||
|
required: false
|
||||||
|
default: ""
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-updates-xml:
|
build-updates-xml:
|
||||||
@@ -108,8 +112,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
python3 - <<'PY'
|
python3 -c $'import os
|
||||||
import os
|
|
||||||
import xml.etree.ElementTree as ET
|
import xml.etree.ElementTree as ET
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
@@ -143,7 +146,20 @@ jobs:
|
|||||||
tree.write(out_path, encoding="utf-8", xml_declaration=True)
|
tree.write(out_path, encoding="utf-8", xml_declaration=True)
|
||||||
|
|
||||||
print(f"Wrote: {out_path}")
|
print(f"Wrote: {out_path}")
|
||||||
PY
|
'
|
||||||
|
- name: Attach updates.xml to GitHub Release
|
||||||
|
if: ${{ github.event_name == 'release' || github.event.inputs.release_tag != '' }}
|
||||||
|
shell: bash
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
RELEASE_TAG: ${{ github.event_name == 'release' && github.event.release.tag_name || github.event.inputs.release_tag }}
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
if [ -z "$RELEASE_TAG" ]; then
|
||||||
|
echo "Missing release tag" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
gh release upload "$RELEASE_TAG" "dist/updates.xml" --clobber
|
||||||
|
|
||||||
- name: Upload updates.xml artifact
|
- name: Upload updates.xml artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
@@ -151,4 +167,6 @@ jobs:
|
|||||||
name: updates-xml
|
name: updates-xml
|
||||||
path: dist/updates.xml
|
path: dist/updates.xml
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
retention-days: 7
|
# GitHub does not support indefinite artifact retention.
|
||||||
|
# This is set to the maximum allowed retention period.
|
||||||
|
retention-days: 90
|
||||||
|
|||||||
Reference in New Issue
Block a user