Skip to content

Commit

Permalink
ci: auto-publish package on FoundryVTT
Browse files Browse the repository at this point in the history
  • Loading branch information
DjLeChuck committed Apr 9, 2024
1 parent da07ba3 commit 5028098
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Create Module Files For GitHub Release


env:
project_url: "https://github.com/${{ github.repository }}"
latest_manifest_url: "https://github.com/${{ github.repository }}/releases/latest/download/module.json"
release_module_url: "https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/module.zip"
project_url: 'https://github.com/${{ github.repository }}'
latest_manifest_url: 'https://github.com/${{ github.repository }}/releases/latest/download/module.json'
release_url: 'https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/module.zip'


on:
Expand All @@ -20,16 +20,16 @@ jobs:
contents: write

steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Checkout repository
uses: actions/checkout@v4

- name: yarn install
run: yarn install

- name: Pack compendiums
run: yarn run pack-packs

- name: Modify Module Manifest With Release-Specific Values
- name: Modify module manifest with release-specific values
id: sub_manifest_link_version
uses: cschleiden/replace-tokens@v1
with:
Expand All @@ -38,9 +38,9 @@ jobs:
VERSION: ${{ github.ref_name }}
URL: ${{ env.project_url }}
MANIFEST: ${{ env.latest_manifest_url }}
DOWNLOAD: ${{ env.release_module_url }}
DOWNLOAD: ${{ env.release_url }}

- name: Create Module Archive
- name: Create module archive
run: |
zip \
--recurse-paths \
Expand All @@ -63,5 +63,12 @@ jobs:
prerelease: ${{ github.event.release.prerelease }}
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: './module.json, ./module.zip'
tag: ${{ github.ref_name }}
tag: ${{ github.event.release.tag_name }}
body: ${{ github.event.release.body }}

- name: Publish the package
id: publish
uses: djlechuck/foundryvtt-publish-package-action@v1
with:
token: ${{ secrets.FOUNDRYVTT_RELEASE_TOKEN }}
manifest: 'https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/module.json'

0 comments on commit 5028098

Please sign in to comment.