Enable auto-release
Release Creation / build (release) Failing after 53s

This commit is contained in:
2026-05-22 14:56:06 +02:00
parent 220891c93f
commit de2175f31c
+51 -58
View File
@@ -7,72 +7,65 @@ on:
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout repository - run: echo "💡 The ${{ gitea.repository }} repository will be cloned to the runner."
uses: actions/checkout@v4
- name: Setup Node.js - uses: RouxAntoine/checkout@v3.5.4
uses: actions/setup-node@v4
# Extrait la version depuis le tag (ex: v1.2.3 → 1.2.3)
- name: Extract tag version number
id: get_version
uses: battila7/get-version-action@v2
# Met à jour version, manifest et download dans system.json
- name: Substitute Manifest and Download Links For Versioned Ones
id: sub_manifest_link_version
uses: microsoft/variable-substitution@v1
with: with:
node-version: "20" files: "system.json"
env:
version: ${{steps.get_version.outputs.version-without-v}}
url: https://www.uberwald.me/gitea/${{gitea.repository}}
manifest: https://www.uberwald.me/gitea/${{gitea.repository}}/releases/download/latest/system.json
download: https://www.uberwald.me/gitea/${{gitea.repository}}/releases/download/${{github.event.release.tag_name}}/fvtt-prism-rpg-${{github.event.release.tag_name}}.zip
- name: Install dependencies # Compile le CSS depuis les sources LESS (gitignored)
run: npm ci - name: Setup Node.js
uses: https://github.com/actions/setup-node@v4
with:
node-version: "22"
- name: Build CSS - name: Build CSS
run: npx gulp css run: npm install && npm run build
- name: Set system.json URLs and version # Crée le zip de release avec tous les fichiers nécessaires au système
run: | - run: |
set -e apt update -y
TAG="${{ github.event.release.tag_name }}" apt install -y zip
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 - run: zip -r ./fvtt-prism-rpg-${{github.event.release.tag_name}}.zip system.json fvtt-prism-rpg.mjs assets/ css/ lang/ module/ styles/ templates/
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 ---" - name: setup go
cat system.json uses: https://github.com/actions/setup-go@v4
with:
go-version: ">=1.20.1"
- name: Package release archive - name: Use Go Action
run: | id: use-go-action
set -e uses: https://gitea.com/actions/release-action@main
zip -r fvtt-prism-rpg.zip \ with:
assets/ \ files: |-
css/ \ ./fvtt-prism-rpg-${{github.event.release.tag_name}}.zip
lang/ \ system.json
module/ \ api_key: "${{secrets.RELEASE_PRISM }}"
templates/ \
prism-rpg.mjs \
system.json \
LICENSE \
README.md \
changelog.md
- name: Upload release assets #- name: Publish to Foundry server
run: | # uses: https://github.com/djlechuck/foundryvtt-publish-package-action@v1
set -e # with:
RELEASE_ID="${{ github.event.release.id }}" # token: ${{ secrets.FOUNDRYVTT_RELEASE_TOKEN }}
GITEA_URL="https://www.uberwald.me/gitea" # id: "fvtt-prism-rpg"
REPO="uberwald/fvtt-prism-rpg" # version: ${{github.event.release.tag_name}}
# manifest: "https://www.uberwald.me/gitea/${{gitea.repository}}/releases/download/latest/system.json"
# Upload fvtt-prism-rpg.zip # notes: "https://www.uberwald.me/gitea/${{gitea.repository}}/releases/download/${{github.event.release.tag_name}}/fvtt-prism-rpg-${{github.event.release.tag_name}}.zip"
curl -sf -X POST \ # compatibility-minimum: "14"
"${GITEA_URL}/api/v1/repos/${REPO}/releases/${RELEASE_ID}/assets?name=fvtt-prism-rpg.zip" \ # compatibility-verified: "14"
-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