Skip to content

v5.7

v5.7 #22

Workflow file for this run

name: Release Creation
env:
# The URL used for the module's "Project URL" link on FoundryVTT's website.
project_url: "https://github.com/${{github.repository}}"
# A URL that will always point to the latest manifest.
# FoundryVTT uses this URL to check whether the current module version that
# is installed is the latest version. This URL should NOT change,
# otherwise FoundryVTT won't be able to perform this check.
latest_manifest_url: "https://github.com/${{github.repository}}/releases/latest/download/module.json"
# The URL to the module archive associated with the module release being
# processed by this workflow.
release_module_url: "https://github.com/${{github.repository}}/releases/download/${{github.event.release.tag_name}}/module.zip"
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Substitute the Manifest and Download URLs in the module.json
- name: Substitute Manifest and Download Links For Versioned Ones
id: sub_manifest_link_version
uses: microsoft/variable-substitution@v1
with:
files: "module.json"
env:
version: ${{github.event.release.tag_name}}
url: https://github.com/${{github.repository}}
manifest: https://github.com/${{github.repository}}/releases/latest/download/module.json
download: https://github.com/${{github.repository}}/releases/download/${{github.event.release.tag_name}}/module.zip
# `npm ci` is recommended:
# https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
- name: Install Dependencies
run: npm ci
# Pull YAML to LDB packs
- name: Build Packs
run: npm run pullYAMLtoLDB
# Create a zip file with all files required by the module to add to the release
- run: zip -r ./module.zip module.json srd-heros-et-dragons.js assets/ modules/ packs/
# Create a release for this specific version
- name: Update Release with Files
id: create_version_release
uses: ncipollo/release-action@v1
with:
allowUpdates: true # Set this to false if you want to prevent updating existing releases
name: ${{ github.event.release.name }}
draft: false
prerelease: false
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: "./module.json, ./module.zip"
tag: ${{ github.event.release.tag_name }}
body: ${{ github.event.release.body }}
- name: Deploy Release
id: deploy_release
uses: fjogeleit/http-request-action@v1
with:
preventFailureOnNoResponse: 'true'
url: 'https://api.foundryvtt.com/_api/packages/release_version'
method: 'POST'
contentType: 'application/json'
customHeaders: '{"Authorization": "${{ secrets.FVTT_MODULE_KEY }}"}'
data: '{"id": "SRD_HD","dry-run":false,"release":{"version":"${{github.event.release.tag_name}}","manifest":"https://github.com/rwanoux/SRD-Heros-et-Dragons/releases/download/${{github.event.release.tag_name}}/module.json","compatibility":{"minimum":"11","verified":"12","maximum":"12"}}}'