Skip to content

build script update #105

build script update

build script update #105

Workflow file for this run

name: Create Module Files For GitHub Release
env:
TAG: ${{ github.event.release.tag_name || github.ref_name }}
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
uses: cschleiden/[email protected]
with:
files: 'module.json'
env:
VERSION: ${{ env.TAG }}
URL: "https://github.com/${{ github.repository }}"
- 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/ \
languages/
- name: Update Release With Files
id: create_version_release
uses: ncipollo/[email protected]
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, ./LICENSE, ./README.md'
tag: ${{ env.TAG }}
body: ${{ github.event.release.body }}
- name: Get Changes between Tags
run: |
PREV_TAG=$(git describe --tags --abbrev=0 ${{ env.TAG }}^)
echo "FILES_CHANGED=$(git diff --name-only $PREV_TAG ${{ env.TAG }})" >> $GITHUB_ENV
echo "CHANGES=$(git log --pretty=format:%s $PREV_TAG..${{ env.TAG }})" >> $GITHUB_ENV
- name: Update Foundry VTT Module Repo
run: |
pip install markdown-it-py --quiet
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 }}