-
Notifications
You must be signed in to change notification settings - Fork 9
56 lines (48 loc) · 2.07 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
name: Release Creation
on:
push:
tags:
- v*
permissions:
contents: write
jobs:
release:
name: Release pushed tag as github release and then publish it to Foundry
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Extract tag version number without the v
id: get-version
run: echo "version-without-v=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
- name: Substitute manifest and download links for versioned ones
id: sub_manifest_link_version
uses: devops-actions/[email protected]
with:
files: module.json
env:
version: ${{ steps.get-version.outputs.version-without-v }}
manifest: https://github.com/${{ github.repository }}/releases/latest/download/module.json
download: https://github.com/${{ github.repository }}/releases/download/${{ steps.get-version.outputs.version-without-v }}/module.zip
- name: Create zip with all important module stuff (skipping unwanted files)
run: zip -r9 ./module.zip assets/ packs/ lang/ scripts/ styles/ Readme.md License.txt Changelog.md module.json
- name: Createu/Update GitHub release with json and zip files
id: create_version_release
uses: ncipollo/release-action@v1
with:
draft: false
prerelease: false
allowUpdates: true
omitDraftDuringUpdate: true
omitPrereleaseDuringUpdate: true
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ steps.get-version.outputs.version-without-v }}
name: ${{ steps.get-version.outputs.version-without-v }}
artifacts: './module.json, ./module.zip'
- name: Publish to FoundryVTT
uses: cs96and/[email protected]
if: ${{ env.PACKAGE_TOKEN }}
env:
PACKAGE_TOKEN: ${{ secrets.PACKAGE_TOKEN }}
with:
package-token: ${{ env.PACKAGE_TOKEN }}
manifest-url: https://github.com/${{ github.repository }}/releases/download/${{ steps.get-version.outputs.version-without-v }}/module.json