-
Notifications
You must be signed in to change notification settings - Fork 7
68 lines (60 loc) · 2.13 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
67
68
name: Release System Version
on:
push:
tags:
- 'v*.*.*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '19'
cache: 'npm'
- run: npm install
- 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: ./
run: zip -r ./system.zip ./assets ./fonts ./lang ./packs/**/* ./src ./tinymce index.js index.js.map style.css system.json template.json LICENSE.txt ChangeLog.md
# Get the version
- name: Get Version
shell: bash
id: get-version
run: echo "version=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
# Extract release notes from ChangeLog
- name: Extract release notes
shell: bash
id: extract-release-notes
run: |
OUTFILE=release-notes.md
utils/extract-release-notes.sh ChangeLog.md > $OUTFILE
echo "release_notes=$OUTFILE" >> $GITHUB_OUTPUT
# 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 }}
bodyFile: ${{ steps.extract-release-notes.outputs.release_notes }}
draft: false
prerelease: false
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: './system.json,./system.zip,./ChangeLog.md'
tag: ${{ steps.get-version.outputs.version }}
# Update the 'latest' release
- name: Create Release
id: create_latest_release
uses: ncipollo/release-action@v1
if: endsWith(github.event.base_ref, 'main')
with:
allowUpdates: true
name: Latest
draft: false
prerelease: false
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: './system.json,./system.zip,./ChangeLog.md'
tag: latest