Add go package upload

This commit is contained in:
Ryan McGuire 2024-12-16 15:55:53 -05:00
parent 990cfbf233
commit c88ec43fca

View File

@ -44,11 +44,13 @@ jobs:
- name: Generate and Upload Package to Go Registry
run: |
ZIPFILE=$( go mod download --json ${GO_MOD_PATH}@${{ github.ref_name }} | jq .Zip )
if [ $? -ne 0 ]; then
go mod download --json ${GO_MOD_PATH}@${{ github.ref_name }} > package.json
if [[ $? -ne 0 ]]; then
echo "Failed to generage go package archive for ${GO_MOD_PATH}@${{ github.ref_name }}"
exit 1
fi
ZIPFILE=$( jq .Zip < package.json )
echo "Uploading go package ${ZIPFILE}"
curl -X PUT \
-H "Authorization: token ${API_TOKEN}" \
--upload-file ${ZIPFILE} \