Files
fvtt-prism-rpg/.gitea/workflows/release.yml
T
uberwald 220891c93f
Release Creation / build (release) Failing after 47s
Enable auto-release
2026-05-22 14:51:16 +02:00

79 lines
2.4 KiB
YAML

name: Release Creation
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Install dependencies
run: npm ci
- name: Build CSS
run: npx gulp css
- name: Set system.json URLs and version
run: |
set -e
TAG="${{ github.event.release.tag_name }}"
VERSION="${TAG#v}"
BASE_URL="https://www.uberwald.me/gitea/uberwald/fvtt-prism-rpg"
# Manifest and download point to the release assets (substituted values, not raw git)
MANIFEST="${BASE_URL}/releases/download/${TAG}/system.json"
DOWNLOAD="${BASE_URL}/releases/download/${TAG}/fvtt-prism-rpg.zip"
sed -i "s|#{MANIFEST}#|${MANIFEST}|g" system.json
sed -i "s|#{DOWNLOAD}#|${DOWNLOAD}|g" system.json
sed -i "s|#{URL}#|${BASE_URL}|g" system.json
sed -i "s|\"version\": \"[^\"]*\"|\"version\": \"${VERSION}\"|g" system.json
echo "--- system.json after substitution ---"
cat system.json
- name: Package release archive
run: |
set -e
zip -r fvtt-prism-rpg.zip \
assets/ \
css/ \
lang/ \
module/ \
templates/ \
prism-rpg.mjs \
system.json \
LICENSE \
README.md \
changelog.md
- name: Upload release assets
run: |
set -e
RELEASE_ID="${{ github.event.release.id }}"
GITEA_URL="https://www.uberwald.me/gitea"
REPO="uberwald/fvtt-prism-rpg"
# Upload fvtt-prism-rpg.zip
curl -sf -X POST \
"${GITEA_URL}/api/v1/repos/${REPO}/releases/${RELEASE_ID}/assets?name=fvtt-prism-rpg.zip" \
-H "Authorization: token ${{ secrets.RELEASE_PRISM }}" \
-H "Content-Type: application/zip" \
--data-binary @fvtt-prism-rpg.zip
# Upload system.json (manifest direct URL)
curl -sf -X POST \
"${GITEA_URL}/api/v1/repos/${REPO}/releases/${RELEASE_ID}/assets?name=system.json" \
-H "Authorization: token ${{ secrets.RELEASE_PRISM }}" \
-H "Content-Type: application/json" \
--data-binary @system.json