Skip to content

Commit

Permalink
Add script to pull modpack name prop for use with workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
fclante committed Mar 26, 2024
1 parent 41df94a commit db8a710
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
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
Expand Down
17 changes: 17 additions & 0 deletions scripts/extract_modpack_name.sh
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit db8a710

Please sign in to comment.