forked from public/foundryvtt-wh4-lang-fr-fr
90 lines
3.1 KiB
YAML
90 lines
3.1 KiB
YAML
name: Release Creation
|
|
|
|
on:
|
|
release:
|
|
types: [published]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- run: echo "💡 The ${{ gitea.repository }} repository will be cloned to the runner."
|
|
|
|
- uses: RouxAntoine/checkout@v3.5.4
|
|
|
|
# Valider les JSON avant de packager
|
|
- name: Valider fr.json et module.json
|
|
run: |
|
|
python3 -mjson.tool fr.json > /dev/null
|
|
python3 -mjson.tool module.json > /dev/null
|
|
|
|
# Générer modules/loadScripts.js depuis scripts/
|
|
- name: Build (génération de loadScripts.js)
|
|
run: node scriptPacker.js
|
|
|
|
# Extraire le numéro de version depuis le tag (sans le 'v' initial)
|
|
- name: Extraire la version depuis le tag
|
|
id: get_version
|
|
uses: battila7/get-version-action@v2
|
|
|
|
# Mettre à jour version, url, manifest et download dans module.json
|
|
- name: Substituer les URLs de Manifest et Download
|
|
id: sub_manifest_link_version
|
|
uses: microsoft/variable-substitution@v1
|
|
with:
|
|
files: 'module.json'
|
|
env:
|
|
version: ${{ steps.get_version.outputs.version-without-v }}
|
|
url: https://www.uberwald.me/gitea/${{ gitea.repository }}
|
|
manifest: https://www.uberwald.me/gitea/public/foundryvtt-wh4-lang-fr-fr/releases/download/latest/module.json
|
|
download: https://www.uberwald.me/gitea/${{ gitea.repository }}/releases/download/${{ github.event.release.tag_name }}/foundryvtt-wh4-lang-fr-fr.zip
|
|
|
|
# Créer le zip avec uniquement les fichiers nécessaires au module Foundry
|
|
- name: Installer zip
|
|
run: |
|
|
apt update -y
|
|
apt install -y zip
|
|
|
|
- name: Créer l'archive foundryvtt-wh4-lang-fr-fr.zip
|
|
run: >
|
|
zip -r ./foundryvtt-wh4-lang-fr-fr.zip
|
|
module.json
|
|
fr.json
|
|
wh4_fr.js
|
|
patch-styles.css
|
|
README.md
|
|
LICENSE
|
|
compendium/
|
|
modules/
|
|
packs/
|
|
icons/
|
|
images/
|
|
trade/
|
|
|
|
# Publier le zip et le module.json sur la release Gitea
|
|
- name: setup go
|
|
uses: https://github.com/actions/setup-go@v4
|
|
with:
|
|
go-version: '>=1.20.1'
|
|
|
|
- name: Publier les assets sur la release Gitea
|
|
id: use-go-action
|
|
uses: https://gitea.com/actions/release-action@main
|
|
with:
|
|
files: |-
|
|
./foundryvtt-wh4-lang-fr-fr.zip
|
|
module.json
|
|
api_key: '${{ secrets.ALLOW_PUSH_RELEASE }}'
|
|
|
|
# Déclarer la release sur le portail FoundryVTT
|
|
- name: Publier sur FoundryVTT
|
|
uses: https://github.com/djlechuck/foundryvtt-publish-package-action@v1
|
|
with:
|
|
token: ${{ secrets.FOUNDRYVTT_RELEASE_TOKEN }}
|
|
id: 'wh4-fr-translation'
|
|
version: ${{ github.event.release.tag_name }}
|
|
manifest: 'https://www.uberwald.me/gitea/public/foundryvtt-wh4-lang-fr-fr/releases/download/latest/module.json'
|
|
notes: 'https://www.uberwald.me/gitea/${{ gitea.repository }}/releases/tag/${{ github.event.release.tag_name }}'
|
|
compatibility-minimum: '13'
|
|
compatibility-verified: '13'
|