Skip to content

6.0.50

6.0.50 #529

Workflow file for this run

name: ddb-importer build
on:
workflow_dispatch:
push:
branches:
- main
paths:
- 'package.json'
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run lint
build:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Get Version # Run the script that returns the version from `module.json`
shell: bash
id: get-version
run: echo "release_version=$(node ./.github/workflows/get-version.js)" >> $GITHUB_OUTPUT
- name: Build module.json
run: node ./.github/workflows/build-module-json.js | jq . > module.json
- run: npm ci
- name: Webpack
run: npm run build
- name: Build icon json
run: ./icon.sh
- name: Create Release Zip
run: zip -r ./ddb-importer.zip module.json dist icons handlebars css img lang data vendor macros LICENSE.md # Add folders/files here
- name: Create Release # Create an additional release for this version
id: create_versioned_release
uses: ncipollo/release-action@v1
with:
allowUpdates: false # set to false if you do not want to allow updates on existing releases
name: Release ${{ steps.get-version.outputs.release_version }} # Use the version in the name "${{ env.version }}"
draft: false
prerelease: false
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: './module.json,./ddb-importer.zip' # don't forget to rename module zip thing
tag: ${{ steps.get-version.outputs.release_version }} # Use the version as the tag
- name: Create Latest Release
id: create_latest_release
uses: ncipollo/release-action@v1
if: endsWith(github.ref, 'main') # Only update the latest release when pushing to the master branch
with:
allowUpdates: true
name: Latest
draft: false
prerelease: false
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: './module.json,./ddb-importer.zip' # don't forget to rename module zip thing
tag: latest
- name: Discord notification
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_HOOK }}
DISCORD_USERNAME: "Head of Marketing (Krum)"
uses: Ilshidur/action-discord@0.3.2
with:
args: 'DDB Importer ${{ steps.get-version.outputs.release_version }} has been published by our development Kobolds!'
- name: FoundryVTT AutoPublish
uses: fjogeleit/http-request-action@v1
continue-on-error: true
with:
url: 'https://api.foundryvtt.com/_api/packages/release_version'
method: 'POST'
customHeaders: '{"Content-Type": "application/json", "Authorization" : "${{ secrets.FOUNDRY_KEY }}"}'
data: '{"dry_run": false, "id" : "ddb-importer", "release": {"version" : "${{ steps.get-version.outputs.release_version }}", "manifest": "https://github.com/${{ github.repository }}/releases/download/${{ steps.get-version.outputs.release_version }}/module.json", "notes" : "https://github.com/${{ github.repository }}/blob/main/CHANGELOG.md", "compatibility" : {"minimum": "12", "verified": "12", "maximum": ""} } }'