forked from sw5e-foundry/sw5e
-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (58 loc) · 2.1 KB
/
release.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
65
66
name: Automatic Versioning
on:
push:
branches:
- master
jobs:
build:
permissions: write-all
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: 16
# Get the most recent version number from the CHANGELOG.md file
- name: Get Most Recent Version Number
id: get_version
run: |
version=$(grep -oP '(?<=^## \[)[0-9.]+(?=\])' CHANGELOG.md | head -n 1)
echo "${version}"
echo "version=${version}" >> $GITHUB_OUTPUT
# Substitute the Manifest and Download URLs in the module.json with the most recent version number
- name: Substitute Manifest and Download Links For Versioned Ones
id: sub_manifest_link_version
uses: microsoft/variable-substitution@v1
with:
files: static/system.json
env:
version: ${{ steps.get_version.outputs.version }}
manifest: https://github.com/sw5e-foundry/sw5e/releases/download/${{ steps.get_version.outputs.version }}/system.json
download: https://github.com/sw5e-foundry/sw5e/releases/download/${{ steps.get_version.outputs.version }}/system.zip
- name: Cache NPM
id: cache-npm
uses: actions/cache@v3
with:
path: node_modules/
key: npm-${{ hashFiles('package-lock.json') }}
- name: Install NPM
if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }}
run: npm ci
- name: Compile with Gulp
working-directory: ./
run: gulp buildAll --dist
- name: Zip Files
working-directory: ./
run: zip -r ./system.zip ./dist/*
- name: Create Release
id: create-release
uses: ncipollo/release-action@v1
with:
allowUpdates: true
name: ${{ steps.get_version.outputs.version }}
draft: false
prerelease: false
token: ${{secrets.GITHUB_TOKEN}}
artifacts: "./system.zip, ./static/system.json"
generateReleaseNotes: true
tag: ${{ steps.get_version.outputs.version }}