diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 9e385bf..2d3557b 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -18,12 +18,16 @@ jobs: files: vanilla-plus/ dest: modpack.zip + - name: Get modpack name + id: get_modpack_name + run: scripts/extract_modpack_name.sh + - uses: GreenTF/upload-thunderstore-package@v4.2 with: namespace: Beeheim # the thunderstore 'team' to publish under description: ${{ github.event.release.body }} token: ${{ secrets.THUNDERSTORE_TOKEN }} - name: ${{ github.event.release.title }} # the name of the package + name: ${{ steps.get_modpack_name.outputs.Name }} # the name of the package version: ${{ github.ref_name }} # Use the tag as the package version community: Valheim # the game the package is for repo: valheim.thunderstore.io diff --git a/scripts/extract_modpack_name.sh b/scripts/extract_modpack_name.sh new file mode 100644 index 0000000..2fafe17 --- /dev/null +++ b/scripts/extract_modpack_name.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# Check if a file path is provided +if [ $# -eq 0 ]; then + echo "No file path provided" + exit 1 +fi + +# Check if the file exists +if [ ! -f $1 ]; then + echo "File not found" + exit 1 +fi + +# Extract the name property +name=$(jq -r '.name' $1) +echo "$name" \ No newline at end of file