-
Notifications
You must be signed in to change notification settings - Fork 4
61 lines (54 loc) · 2.15 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
name: Module Builder
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Zip Files
working-directory: ./
run: zip -r ./module.zip ./*
- name: Get Version
shell: bash
id: get-version
run: echo "version=$(node ./.github/workflows/get-version.js)" >> $GITHUB_OUTPUT
- name: Create Release
id: create-release
uses: ncipollo/release-action@v1
with:
allowUpdates: true
name: Release ${{ steps.get-version.outputs.version }}
draft: false
prerelease: false
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: './module.zip, ./module.json'
tag: ${{ steps.get-version.outputs.version }}
- name: Release Foundry Package
run: |
API_TOKEN="${{ secrets.FOUNDRY_API_TOKEN }}"
PACKAGE_ID="gambits-premades"
PACKAGE_VERSION="${{ steps.get-version.outputs.version }}"
MANIFEST_URL="https://github.com/gambit07/gambits-premades/releases/latest/download/module.json"
RELEASE_NOTES_URL="https://github.com/gambit07/gambits-premades/releases/tag/${{ steps.get-version.outputs.version }}"
FOUNDRY_MIN_VERSION="11"
FOUNDRY_VERIFIED_VERSION="11"
FOUNDRY_MAX_VERSION="11"
curl -X POST "https://api.foundryvtt.com/_api/packages/release_version" \
-H "Content-Type: application/json" \
-H "Authorization: ${{ secrets.FOUNDRY_API_TOKEN }}" \
-d '{
"id": "'"gambits-premades"'",
"release": {
"version": "'"${{ steps.get-version.outputs.version }}"'",
"manifest": "'"https://github.com/gambit07/gambits-premades/releases/download/${{ steps.get-version.outputs.version }}/module.json"'",
"notes": "'"https://github.com/gambit07/gambits-premades/releases/tag/${{ steps.get-version.outputs.version }}"'",
"compatibility": {
"minimum": "'"11"'",
"verified": "'"11"'",
"maximum": "'"11"'"
}
}
}'