Skip to content

Merge pull request #5 from EddieDover/version-fix-2 #5

Merge pull request #5 from EddieDover/version-fix-2

Merge pull request #5 from EddieDover/version-fix-2 #5

Workflow file for this run

# Thanks to Calego / ElfFriend (https://github.com/ElfFriend-DnD/) for the initial reference for this GH Action.
name: Module Tag / Release
on:
push:
tags:
- "v*"
jobs:
build:
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 }}
- name: Install dependencies
run: npm ci
# run the build action; choose `build-deploy` if not minifying your output bundle.
- name: Build deploy directory
run: npm run build-deploy-compress
# create a zip file with all files required by the module to add to the release
- name: Zip Files
working-directory: ./deploy
run: zip -r ./module.zip ./*
# Get the version from 'module.json'
- name: Get Version
shell: bash
id: get-version
run: echo "version=$(node ./.github/workflows/get-version.js)" >> "$GITHUB_OUTPUT"
# Generate changelog for release body
- name: Changelog
id: Changelog
uses: scottbrenner/generate-changelog-action@master
env:
REPO: ${{ github.repository }}
# Create a release for this specific version
- name: Create Release
id: create_version_release
uses: ncipollo/release-action@v1
with:
allowUpdates: true # set this to false if you want to prevent updating existing releases
name: ${{ steps.get-version.outputs.version }}
body: |
${{ steps.Changelog.outputs.changelog }}
draft: false
prerelease: false
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: './deploy/module.json,./deploy/module.zip'
tag: ${{ steps.get-version.outputs.version }}