Cthulhu Deep Green v1.0.5 #22
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
# Based on the workflows of: | |
# https://github.com/League-of-Foundry-Developers/FoundryVTT-Module-Template and | |
# https://github.com/pwatson100/alienrpg | |
name: Release Creation | |
env: | |
# The URL used for the system'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 system 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/system.json" | |
# The URL to the system archive associated with the system release being | |
# processed by this workflow. | |
release_system_url: "https://github.com/${{github.repository}}/releases/download/${{github.event.release.tag_name}}/system.zip" | |
on: | |
release: | |
types: [published] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
# Extract version embedded in the tag. | |
# This step expects the tag to be one of the following formats: | |
# - "v<major>.<minor>.<patch>" (e.g., "v1.2.3") | |
# - "<major>.<minor>.<patch>" (e.g., "1.2.3") | |
# | |
# The version will be used by later steps to fill in the value for the | |
# "version" key required for a valid system manifest. | |
- name: Extract Version From Tag | |
id: get_version | |
uses: battila7/get-version-action@v2 | |
# Modify "system.json" with values specific to the release. | |
# Since the values for the "version" and "url" keys aren't known ahead of | |
# time, the manifest file in the repository is updated with these values. | |
# | |
# While this does modify the manifest file in-place, the changes are not | |
# commited to the repository, and only exist in the action's filesystem. | |
- name: Modify system Manifest With Release-Specific Values | |
id: sub_manifest_link_version | |
uses: cschleiden/replace-tokens@v1 | |
with: | |
files: 'system.json' | |
env: | |
VERSION: ${{steps.get_version.outputs.version-without-v}} | |
URL: ${{ env.project_url }} | |
MANIFEST: ${{ env.latest_manifest_url }} | |
DOWNLOAD: ${{ env.release_system_url }} | |
# create a zip file with all files required by the system to add to the release | |
- run: zip -r ./system.zip system.json template.json README.md LICENSE templates/ module/ lang/ css/ assets/ | |
# 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, ./system.zip" | |
tag: ${{ github.event.release.tag_name }} | |
body: ${{ github.event.release.body }} |