Skip to content

v5.7.0

v5.7.0 #148

Workflow file for this run

name: Release Creation
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Remove the 'v' from the tag for versioning
- id: get_version
run: |
echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV
echo "FOUNDRY_MANIFEST=https://github.com/${{github.repository}}/releases/latest/download/module.json" >> $GITHUB_ENV
echo "FOUNDRY_DOWNLOAD=https://github.com/${{github.repository}}/releases/download/${{github.event.release.tag_name}}/module.zip" >> $GITHUB_ENV
- name: Substitute Manifest and Download Links For Versioned Ones
id: sub_manifest_link_version
uses: restackio/update-json-file-action@v2.0
with:
file: './public/module.json'
fields: '{"version": "${{env.VERSION}}", "manifest": "${{env.FOUNDRY_MANIFEST}}", "download": "${{env.FOUNDRY_DOWNLOAD}}"}'
- name: Install and Build
run: |
npm install
npm run build
# create a zip file with all files required by the module to add to the release
- name: Zip the dist
run: |
cd ./dist
zip -r ./module.zip *
# Update Release with Files
- name: Create Release
uses: ncipollo/release-action@v1.13.0
id: create_version_release
with:
allowUpdates: true # set this to false if you want to prevent updating existing releases
name: ${{ github.event.release.name }}
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: './dist/module.json, ./dist/module.zip'
tag: ${{ github.event.release.tag_name }}
body: ${{ github.event.release.body }}
prerelease: ${{ github.event.release.prerelease }}
makeLatest: false
- name: Publish Module to FoundryVTT Website
if: ${{ !github.event.release.prerelease }}
id: publish-to-foundry-website
uses: cs96and/FoundryVTT-release-package@v1
with:
package-token: ${{ secrets.PACKAGE_TOKEN }}
manifest-url: https://github.com/${{github.repository}}/releases/download/${{github.event.release.tag_name}}/module.json
notes-url: https://github.com/${{github.repository}}/releases/tag/${{github.event.release.tag_name}}