diff --git a/.forgejo/workflows/main.yml b/.forgejo/workflows/main.yml new file mode 100644 index 0000000..ce38a92 --- /dev/null +++ b/.forgejo/workflows/main.yml @@ -0,0 +1,56 @@ +name: Release Creation +env: + # The URL used for the module's "Project URL" link on FoundryVTT's website. + project_url: "https://git.solarpunk.moe/${{github.repository}}" + + # A URL that will always point to the latest manifest. + # FoundryVTT uses this URL to check whether the current module version that + # is installed is the latest version. This URL should NOT change, + # otherwise FoundryVTT won't be able to perform this check. + latest_manifest_url: "https://git.solarpunk.moe/${{github.repository}}/releases/latest/download/system.json" + + # The URL to the module archive associated with the module release being + # processed by this workflow. + release_module_url: "https://git.solarpunk.moe/${{github.repository}}/releases/download/${{github.event.release.tag_name}}/beam-saber.zip" + +on: [tag] +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + # get part of the tag after the `v` + - name: Extract tag version number + id: get_version + uses: battila7/get-version-action@v2 + + # Substitute the Manifest and Download URLs in the system.json + - name: Substitute Manifest and Download Links For Versioned Ones + id: sub_manifest_link_version + uses: microsoft/variable-substitution@v1 + with: + files: "system.json" + env: + version: ${{steps.get_version.outputs.version-without-v}} + url: ${{ env.project_url }} + manifest: ${{ env.latest_manifest_url }} + download: ${{ env.release_module_url }} + + # Create a zip file with all files required by the module to add to the release + - run: zip -r ./beam-saber.zip system.json LICENSE.txt README.md ReleaseNotes.md FAQ.md css/ assets/ templates/ lang/ module/ packs/ tours/ template.json + + # Create a release for this specific version + - name: Update Release with Files + id: create_version_release + uses: ncipollo/release-action@v1 + with: + allowUpdates: true # Set this to false if you want to prevent updating existing releases + name: ${{ github.event.release.name }} + draft: ${{ github.event.release.unpublished }} + prerelease: ${{ github.event.release.prerelease }} + token: ${{ secrets.GITHUB_TOKEN }} + artifacts: "./system.json, ./beam-saber.zip" + tag: ${{ github.event.release.tag_name }} + body: ${{ github.event.release.body }}