v8.0.0 #202
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}} |