Release Creation #75
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
# This is a basic workflow that is manually triggered | |
name: Release Creation | |
# Controls when the action will run. Workflow runs when release is published. | |
on: | |
release: | |
types: [published] | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called buildPacks | |
buildPacks: | |
# The type of runner that the job will run on. This must be ubuntu for the zip command to work. | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Each step runs a single command using the runners shell. | |
# 1. Checkout our repository so we can do things on it. | |
- name: Checkout | |
uses: actions/checkout@v4 | |
# 2. Make sure node is set up. This may be an unecessary step. | |
- name: Node Setup | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
# 3. Install the FoundryVTT CLI. | |
- run: npm install -g @foundryvtt/foundryvtt-cli | |
# 4. Configure the datapath as the github workspace variable. | |
- run: fvtt configure set "dataPath" ${GITHUB_WORKSPACE} | |
# 5. Tell the FVTT CLI that we are working on a "system" package. | |
- run: fvtt package workon fvtt package workon "alienrpg" --type "System" | |
# 6-11. Package each folder of source json files into the appropriate LevelDB pack. | |
- run: fvtt package pack "alien-rpg-system" --in "packs/source/alien-rpg-system" --out "packs" | |
#Substitute the Manifest and Download URLs in the module.json | |
- name: Substitute Manifest and Download Links For Versioned Ones | |
id: sub_release_manifest_version | |
uses: microsoft/variable-substitution@v1 | |
with: | |
files: 'system.json' | |
env: | |
version: ${{github.event.release.tag_name}} | |
url: https://github.com/${{github.repository}} | |
manifest: https://github.com/${{github.repository}}/releases/latest/download/system.json | |
download: https://github.com/${{github.repository}}/releases/download/${{github.event.release.tag_name}}/master.zip | |
# create a zip file with all files required by the module to add to the release | |
- run: zip -r ./master.zip --exclude="*packs/source/*" system.json template.json README.md Realease_Notes.txt ui/ templates/ packs/ module/ macros/ lang/ images/ css/ fonts/ | |
# 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: './system.json, ./master.zip' | |
tag: ${{ github.event.release.tag_name }} | |
body: ${{ github.event.release.body }} | |
# Update the 'latest' release | |
- name: Create Release | |
id: create_latest_release | |
uses: ncipollo/release-action@v1 | |
if: endsWith(github.ref, 'master') | |
with: | |
allowUpdates: true | |
name: Latest | |
draft: false | |
prerelease: false | |
token: ${{ secrets.GITHUB_TOKEN }} | |
artifacts: './system.json,./master.zip' | |
tag: latest | |
body: ${{ github.event.release.body }} |