-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (67 loc) · 3.13 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
74
75
76
77
78
79
80
81
name: Create files for GitHub Release
env:
project_url: 'https://github.com/${{ github.repository }}'
latest_manifest_url: 'https://github.com/${{ github.repository }}/releases/latest/download/system.json'
release_url: 'https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/system.zip'
on:
push:
tags:
- '*'
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Build assets [1/2] - yarn install
run: yarn install
- name: Build assets [2/2] - yarn build
run: NODE_ENV=production yarn run build
- name: Pack compendiums
run: yarn run pack-packs
- name: Modify manifest with release-specific values
id: sub_manifest_link_version
uses: cschleiden/replace-tokens@v1
with:
files: 'system.json'
env:
VERSION: ${{ github.ref_name }}
URL: ${{ env.project_url }}
MANIFEST: ${{ env.latest_manifest_url }}
DOWNLOAD: ${{ env.release_url }}
- name: Create archive
run: |
zip \
--recurse-paths \
./system.zip \
system.json \
template.json \
README.md \
CHANGELOG.md \
LICENSE \
assets/ \
fonts/ \
images/ \
lang/ \
packs/ \
templates/
- name: Update release with files
id: create_version_release
uses: ncipollo/release-action@v1
with:
allowUpdates: true
name: ${{ github.event.release.name }}
draft: ${{ github.event.release.unpublished }}
prerelease: ${{ github.event.release.prerelease }}
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: './system.json, ./system.zip'
tag: ${{ github.event.release.tag_name }}
body: ${{ github.event.release.body }}
- name: Publish the package
id: publish
uses: djlechuck/foundryvtt-publish-package-action@v1
with:
token: ${{ secrets.FOUNDRYVTT_RELEASE_TOKEN }}
manifest: 'https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/system.json'