Merge pull request #1 from EddieDover/dev #1
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 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Use Node.js | |
uses: actions/setup-node@v1 | |
with: | |
node-version: '14.x' | |
- 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 "::set-output name=version::$(node ./.github/workflows/get-version.js)" | |
# 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_name: ${{ steps.get-version.outputs.version }} |