diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0785eec..9fd0ee2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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: @@ -20,8 +20,8 @@ jobs: contents: write steps: - - name: Checkout Repository - uses: actions/checkout@v3 + - name: Checkout repository + uses: actions/checkout@v4 - name: yarn install run: yarn install @@ -29,7 +29,7 @@ jobs: - 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: @@ -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 \ @@ -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'