-
-
Notifications
You must be signed in to change notification settings - Fork 2
64 lines (53 loc) · 1.84 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# 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.cjs)" >> "$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 }}