Skip to content

Release Creation

Release Creation #56

Workflow file for this run

name: Release Creation
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# 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: cschleiden/replace-tokens@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
CHANGELOG: https://github.com/${{ github.repository }}/releases/tag/${{ github.event.release.tag_name }}
# Create a zip file with all files required by the module to add to the release
- name: Zip Files
id: zip_files
run: zip -r ./module.zip lang/ scripts/ styles/ templates/ LICENSE module.json
# 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
omitNameDuringUpdate: true
omitBodyDuringUpdate: true
omitDraftDuringUpdate: true
omitPrereleaseDuringUpdate: true
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: './module.json, ./module.zip'
tag: ${{ github.event.release.tag_name }}
# Publish the release to FoundryVTT's package repository.
- name: Publish Module to FoundryVTT Website
id: publish_to_foundry_website
if: ${{ !github.event.release.unpublished && !github.event.release.prerelease }}
uses: cs96and/FoundryVTT-release-package@v1
with:
package-token: ${{ secrets.FOUNDRY_PACKAGE_TOKEN }}
manifest-url: https://github.com/${{ github.repository }}/releases/download/${{ github.event.release.tag_name }}/module.json