Skip to content

v12.0.3

v12.0.3 #42

Workflow file for this run

name: Release CI
on:
release:
types:
- published
env:
# 'system' or 'module'
TYPE: system
jobs:
release:
name: Create & Publish Release
# if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: 📡 Checkout
uses: actions/checkout@v3
# Configures NodeJS.
- name: ⚙️ Setup NodeJS 16
uses: actions/setup-node@v3
with:
node-version: 16
# Installs & builds.
- name: 🔧 Install Dependencies
run: npm ci
- name: 🧱 Build Project
run: npm run build
# Gets the system/module name.
- name: 📄 Get Name
id: name
uses: notiz-dev/github-action-json-property@release
with:
path: dist/${{ env.TYPE }}.json
prop_path: id
# Gets the version tag.
- name: 📄 Get Version
id: version
uses: notiz-dev/github-action-json-property@release
with:
path: dist/${{ env.TYPE }}.json
prop_path: version
# - name: 🏷️ Get Version Tag
# id: version
# uses: ncipollo/[email protected]
# with:
# tag: ${{ github.event.release.tag_name }}
# Substitute the Manifest and Download URLs in the module.json
- name: 📝 Substitute Manifest and Download Links For Versioned Ones
id: manifest_link_version
uses: microsoft/variable-substitution@v1
with:
files: dist/${{ env.TYPE }}.json
env:
# version: ${{ steps.version.outputs.prop }}
manifest: https://github.com/${{ github.repository }}/releases/latest/download/${{ env.TYPE }}.json
download: https://github.com/${{ github.repository }}/releases/download/${{ github.event.release.tag_name }}/${{ steps.name.outputs.prop }}-fvtt_v${{ steps.version.outputs.prop }}.zip
# Generates the changelog.
# - name: 📜 Generate Changelog
# id: changelog
# uses: mikepenz/[email protected]
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Creates the ZIP artifact.
- name: 📦 Create ZIP Archive
run: |
cd dist/
zip -r ../${{ steps.name.outputs.prop }}-fvtt_v${{ steps.version.outputs.prop }}.zip *
# Creates the release with its artifacts and description.
- name: 🚀 Update Release with Artifacts
uses: ncipollo/[email protected]
with:
allowUpdates: true
name: ${{ github.event.release.name }}
draft: false
prerelease: false
tag: ${{ steps.version.outputs.tag }}
body: ${{ github.event.release.body }}
artifacts: './${{ steps.name.outputs.prop }}-fvtt_v${{ steps.version.outputs.prop }}.zip, ./dist/${{ env.TYPE }}.json'
token: ${{ secrets.GITHUB_TOKEN }}
# Publishes the release to the FoundryVTT's package repository.
- name: 🚩 Publish Module to FoundryVTT Website
uses: Varriount/[email protected]
with:
username: ${{ secrets.FOUNDRY_ADMIN_USERNAME }}
password: ${{ secrets.FOUNDRY_ADMIN_PASSWORD }}
module-id: ${{ secrets.FOUNDRY_ADMIN_MODULE_NAME }}
manifest-url: https://github.com/${{ github.repository }}/releases/download/${{ github.event.release.tag_name }}/${{ env.TYPE }}.json
manifest-file: dist/${{ env.TYPE }}.json