build script update #85
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: Create Module Files For GitHub Release | |
env: | |
URL: "https://github.com/${{ github.repository }}" | |
MANIFEST: "https://github.com/${{ github.repository }}/releases/latest/download/module.json" | |
VERSION: "${{ github.event.release.tag_name || github.ref_name }}" | |
DOWNLOAD: "https://github.com/${{ github.repository }}/releases/download/${{ github.event.release.tag_name || github.ref_name }}/module.zip" | |
on: | |
release: | |
types: [ published ] | |
push: | |
tags: | |
- '[0-9]+.[0-9]+.[0-9]+' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Modify Module Manifest With Release-Specific Values | |
id: sub_manifest_link_version | |
uses: cschleiden/replace-tokens@v1.2 | |
with: | |
files: 'module.json' | |
- name: Downloading Dependencies | |
run: npm install --omit=dev | |
- name: Build | |
run: npm run build | |
- name: Create Module Archive | |
run: | | |
zip \ | |
--recurse-paths \ | |
./module.zip \ | |
module.json \ | |
README.md \ | |
LICENSE \ | |
templates \ | |
dist/ \ | |
styles/ \ | |
packs/ \ | |
languages/ | |
- name: Update Release With Files | |
id: create_version_release | |
uses: ncipollo/release-action@v1.13.0 | |
with: | |
allowUpdates: true | |
name: ${{ github.event.release.name }} | |
draft: ${{ github.event.release.unpublished }} | |
prerelease: ${{ github.event.release.prerelease }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
artifacts: './module.json, ./module.zip' | |
tag: ${{ github.event.release.tag_name }} | |
body: ${{ github.event.release.body }} | |
- name: Get Changes between Tags | |
id: changes | |
uses: simbo/changes-between-tags-action@v1 | |
with: | |
include-hashes: false | |
tag-pattern: ^[0-9]+\.[0-9]+\.[0-9]+$ | |
- name: Update Foundry VTT Module Repo | |
run: | | |
pip install markdown-it-py | |
python .github/workflows/foundry_release.py | |
env: | |
FOUNDRY_PACKAGE_RELEASE_TOKEN: ${{ secrets.FOUNDRY_PACKAGE_RELEASE_TOKEN }} | |
FOUNDRY_USERNAME: ${{ secrets.FOUNDRY_USERNAME }} | |
FOUNDRY_PASSWORD: ${{ secrets.FOUNDRY_PASSWORD }} | |
FOUNDRY_AUTHOR: ${{ secrets.FOUNDRY_AUTHOR }} | |
UPDATE_DISCORD_KEY: ${{ secrets.UPDATE_DISCORD_KEY }} | |
CHANGES: ${{ steps.changes.outputs.changes }} |