forked from xdy/xdy-pf2e-workbench
-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (79 loc) · 3.12 KB
/
test-release.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
82
83
84
85
86
87
88
89
90
91
92
93
94
name: Test and release
# Run the workflow when a Pull Request is opened or when changes are pushed to main on 'xdy/xdy-pf2e-workbench' (i.e. don't run on forks)
on:
pull_request:
push:
branches: [ main ]
#TODO Parse out these, for now they're hardcoded.
env:
fvtt_minimum: 11.314
fvtt_verified: 11.315
fvtt_maximum: 11
jobs:
release:
# Only release on push to main on xdy/xdy-pf2e-workbench
if: github.event_name == 'push' && (github.ref == 'refs/heads/main') && github.repository == 'xdy/xdy-pf2e-workbench'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: 'true'
# Not sure this is the right way to do it, but, eh, it works.
- name: Pull & update submodules recursively
run: |
git submodule update --init --recursive
git submodule update --recursive --remote
- uses: stefanzweifel/git-auto-commit-action@v5.0.0
with:
commit_message: "chore: Update submodules"
- name: Setup Node.js
uses: actions/setup-node@v4.0.1
with:
node-version: 18.x
cache: 'npm'
- name: Install
run: npm install
- name: install fvtt cli
id: fvtt-install
run: npm install -g @foundryvtt/foundryvtt-cli
- name: Build packs
run: npm run build:packs
- name: Build
run: npm run build
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
- name: get-npm-version
id: package-version
uses: martinbeentjes/npm-get-version-action@v1.3.1
- name: Submit package to FoundryVTT Package Release API
run: |
curl -X POST "https://api.foundryvtt.com/_api/packages/release_version/" \
-H "Content-Type: application/json" \
-H "Authorization: ${{ secrets.FOUNDRYVTT_RELEASE_TOKEN }}" \
-d '{
"id": "xdy-pf2e-workbench",
"dry-run": false,
"release": {
"version": "${{ steps.package-version.outputs.current-version}}",
"manifest": "https://github.com/${{ github.repository }}/releases/latest/download/module.json",
"notes": "https://github.com/${{ github.repository }}/blob/master/CHANGELOG.md",
"compatibility": {
"minimum": "${{ env.fvtt_minimum }}",
"verified": "${{ env.fvtt_verified }}",
"maximum": "${{ env.fvtt_maximum }}"
}
}
}'
# # Publish the release to FoundryVTT's package repository.
# - name: Publish Module to FoundryVTT Website
# uses: Varriount/fvtt-autopublish@v2.0.1
# with:
# username: ${{ secrets.FOUNDRY_ADMIN_USERNAME }}
# password: ${{ secrets.FOUNDRY_ADMIN_PASSWORD }}
# module-id: ${{ secrets.FOUNDRY_ADMIN_PACKAGE_ID }}
# manifest-url: https://github.com/${{ github.repository }}/releases/latest/download/module.json
# manifest-file: './static/module.json'