generated from League-of-Foundry-Developers/FoundryVTT-Module-Template
-
-
Notifications
You must be signed in to change notification settings - Fork 3
75 lines (65 loc) · 2.35 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
name: Create Module Files For GitHub Release
env:
GITHUB_URL: "https://github.com/${{ github.repository }}"
TAG: ${{ github.event.release.tag_name || github.ref_name }}
on:
release:
types: [ published ]
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Modify Module Manifest With Release-Specific Values
uses: cschleiden/[email protected]
with:
files: 'module.json'
- name: Downloading Dependencies
run: npm install --omit=dev
- name: Build
run: npm run build
- name: Create Module Archive
run: |
zip \
--recurse-paths \
./module.zip \
module.json \
README.md \
LICENSE \
templates \
dist/ \
styles/ \
languages/
- name: Update Release With Files
id: create_version_release
uses: ncipollo/[email protected]
with:
allowUpdates: true
name: ${{ github.event.release.name }}
draft: ${{ github.event.release.unpublished }}
prerelease: ${{ github.event.release.prerelease }}
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: './module.json, ./module.zip, ./LICENSE, ./README.md'
tag: ${{ env.TAG }}
body: ${{ github.event.release.body }}
- name: Update Foundry VTT Module Repo
run: |
pip install markdown-it-py --quiet
PREV_TAG=$(git describe --tags --abbrev=0 ${{ env.TAG }}^)
export FILES_CHANGED=$(git diff --name-only "$PREV_TAG" "${{ env.TAG }}")
export CHANGES=$(git log --pretty=format:%s "$PREV_TAG".."${{ env.TAG }}")
python .github/workflows/foundry_release.py
env:
FOUNDRY_PACKAGE_RELEASE_TOKEN: ${{ secrets.FOUNDRY_PACKAGE_RELEASE_TOKEN }}
FOUNDRY_USERNAME: ${{ secrets.FOUNDRY_USERNAME }}
FOUNDRY_PASSWORD: ${{ secrets.FOUNDRY_PASSWORD }}
FOUNDRY_AUTHOR: ${{ secrets.FOUNDRY_AUTHOR }}
UPDATE_DISCORD_KEY: ${{ secrets.UPDATE_DISCORD_KEY }}