-
Notifications
You must be signed in to change notification settings - Fork 16
73 lines (67 loc) · 2.3 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
65
66
67
68
69
70
71
72
73
name: Release Creation
on:
push:
tags:
- 'v*'
release:
types: [published]
env:
MODULE_ID: dnd5e-spellpoints
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
# Get part of the tag after the `v`.
- name: Extract tag version number
id: get_version
uses: battila7/get-version-action@v2
# Modify manifest version, download, esmodules, styles, remove hotreload.
- name: Modify Manifest to remove HotReload
uses: microsoft/variable-substitution@v1
with:
files: "module.json"
env:
flags.hotReload: false
version: ${{steps.get_version.outputs.version-without-v}}
id: ${{env.MODULE_ID}}
url: https://github.com/${{ github.repository }}
download: https://github.com/${{ github.repository }}/releases/download/${{steps.get_version.outputs.version}}/${{env.MODULE_ID}}.zip
manifest: https://github.com/${{ github.repository }}/releases/latest/download/module.json
# Create zip file.
- name: Create ZIP archive
run: zip -r ./${{env.MODULE_ID}}.zip
module.json
README.md
LICENSE
CHANGELOG.md
css/
img/
lang/
packs/
scripts/
templates/
# Get the release notes and set a convenient 'id' for accessing later
- name: Read release notes and add to package
uses: yashanand1910/[email protected]
id: get_release_notes
with:
changelog_path: ./CHANGELOG.md # Optional
version: ${{steps.get_version.outputs.version}} # Required
# Create a release for this specific version.
- name: Update Release with Files
if: '!github.event.release.prerelease'
id: create_version_release
uses: ncipollo/release-action@v1
with:
allowUpdates: true
name: ${{ github.event.release.name }}
draft: false
prerelease: false
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: "./module.json, ./${{env.MODULE_ID}}.zip"
tag: ${{ github.event.release.tag_name }}
body: ${{ steps.get_release_notes.outputs.release_notes }}