v1.8.9-g #40
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: | |
push: | |
branches: ['master-2'] | |
permissions: | |
contents: write | |
jobs: | |
release: | |
name: Release pushed tag as github release and then publish it to Foundry | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Extract tag version number without the v from latest commit message | |
id: get-version | |
run: echo "version-without-v=${github.event.head_commit.message#v}" >> "$GITHUB_OUTPUT" | |
# Create the release on GitHub | |
- name: Create release on Github | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh release create "${{ steps.get-version.outputs.version-without-v }}" \ | |
--repo="$GITHUB_REPOSITORY" \ | |
--title="${{ steps.get-version.outputs.version-without-v }}" \ | |
--generate-notes | |
- name: Substitute manifest and download links for versioned ones | |
id: sub_manifest_link_version | |
uses: devops-actions/[email protected] | |
with: | |
files: module.json | |
env: | |
version: ${{ steps.get-version.outputs.version-without-v }} | |
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 | |
# Create a folder containing all the module stuff and zip it for the release | |
- name: Create zip | |
run: zip -r9 ./module.zip lang/ scripts/ styles/ Readme.md License.txt Changelog.md module.json | |
# Update the release on GitHub | |
- name: Update GitHub release with json and zip files | |
id: create_version_release | |
uses: ncipollo/release-action@v1 | |
with: | |
draft: false | |
prerelease: false | |
allowUpdates: true | |
omitDraftDuringUpdate: true | |
omitPrereleaseDuringUpdate: true | |
token: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${{ steps.get-version.outputs.version-without-v }} | |
name: ${{ steps.get-version.outputs.version-without-v }} | |
artifacts: './module.json, ./module.zip' | |
# Update the release on GitHub | |
- name: Publish to FoundryVTT | |
uses: cs96and/[email protected] | |
if: ${{ !github.event.release.prerelease && env.PACKAGE_TOKEN }} | |
env: | |
PACKAGE_TOKEN: ${{ secrets.PACKAGE_TOKEN }} | |
with: | |
package-token: ${{ env.PACKAGE_TOKEN }} | |
manifest-url: https://github.com/${{ github.repository }}/releases/download/${{ github.event.release.tag_name }}/module.json |