Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use FNNDSC/chrisstore-action #37

Open
jennydaman opened this issue Feb 3, 2022 · 0 comments
Open

Use FNNDSC/chrisstore-action #37

jennydaman opened this issue Feb 3, 2022 · 0 comments

Comments

@jennydaman
Copy link
Contributor

- name: Upload to ChRIS Store
if: "!endsWith(steps.determine.outputs.dock_image, ':latest')"
run: |
dock_image=${{ steps.determine.outputs.dock_image }}
plname="$(sed 's/^.*\///' <<< $GITHUB_REPOSITORY)" && echo "name=$plname"
descriptor_file=$(mktemp --suffix .json)
cat > $descriptor_file << ENDOFPLUGINJSONDESCRIPTION
${{ steps.pluginmeta.outputs.json }}
ENDOFPLUGINJSONDESCRIPTION
res=$(
curl -s -u "${{ secrets.CHRIS_STORE_USER }}" "https://chrisstore.co/api/v1/plugins/" \
-H 'Accept:application/vnd.collection+json' \
-F "name=$plname" \
-F "dock_image=$dock_image" \
-F "descriptor_file=@$descriptor_file" \
-F "public_repo=https:/${{ github.repository }}"
)
success=$?
echo "::debug::$res"
if [ "$success" = "0" ]; then
href="$(jq -r '.collection.items[0].href' <<< "$res")"
echo $href
echo "::set-output name=pluginurl::$href"
else
echo "::error ::Failed upload to ChRIS Store"
echo "$res"
exit $success
fi

That block of code was sectioned out and put into its own action here:

https:/FNNDSC/chrisstore-action

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant