-
Notifications
You must be signed in to change notification settings - Fork 31
77 lines (71 loc) · 3.34 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
# This is a basic workflow that is manually triggered
name: Release Creation
# Controls when the action will run. Workflow runs when release is published.
on:
release:
types: [published]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called buildPacks
buildPacks:
# The type of runner that the job will run on. This must be ubuntu for the zip command to work.
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Each step runs a single command using the runners shell.
# 1. Checkout our repository so we can do things on it.
- name: Checkout
uses: actions/checkout@v4
# 2. Make sure node is set up. This may be an unecessary step.
- name: Node Setup
uses: actions/setup-node@v3
with:
node-version: 18
# 3. Install the FoundryVTT CLI.
- run: npm install -g @foundryvtt/foundryvtt-cli
# 4. Configure the datapath as the github workspace variable.
- run: fvtt configure set "dataPath" ${GITHUB_WORKSPACE}
# 5. Tell the FVTT CLI that we are working on a "system" package.
- run: fvtt package workon fvtt package workon "alienrpg" --type "System"
# 6-11. Package each folder of source json files into the appropriate LevelDB pack.
- run: fvtt package pack "alien-rpg-system" --in "src/packs/alien-rpg-system" --out "packs"
#Substitute the Manifest and Download URLs in the module.json
- name: Substitute Manifest and Download Links For Versioned Ones
id: sub_release_manifest_version
uses: microsoft/variable-substitution@v1
with:
files: 'system.json'
env:
version: ${{github.event.release.tag_name}}
url: https://github.com/${{github.repository}}
manifest: https://github.com/${{github.repository}}/releases/latest/download/system.json
download: https://github.com/${{github.repository}}/releases/download/${{github.event.release.tag_name}}/master.zip
# create a zip file with all files required by the module to add to the release
- run: zip -r ./master.zip system.json template.json README.md Realease_Notes.txt ui/ templates/ packs/ module/ macros/ lang/ images/ css/ fonts/
# Create a release for this specific version
- name: Update Release with Files
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: ${{ github.event.release.name }}
draft: false
prerelease: false
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: './system.json, ./master.zip'
tag: ${{ github.event.release.tag_name }}
body: ${{ github.event.release.body }}
# Update the 'latest' release
- name: Create Release
id: create_latest_release
uses: ncipollo/release-action@v1
if: endsWith(github.ref, 'master')
with:
allowUpdates: true
name: Latest
draft: false
prerelease: false
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: './system.json,./master.zip'
tag: latest
body: ${{ github.event.release.body }}