updated workflow #14
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
# 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 | |
permissions: | |
contents: write | |
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 | |
# create a zip file with all files required by the module to add to the release | |
- name: Zip Files | |
working-directory: ./dist | |
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: v${{ steps.get-version.outputs.version }} | |
body: | | |
${{ steps.Changelog.outputs.changelog }} | |
draft: false | |
prerelease: false | |
artifacts: './dist/module.json,./dist/module.zip' | |
tag: v${{ steps.get-version.outputs.version }} |