Add go package upload
This commit is contained in:
parent
990cfbf233
commit
c88ec43fca
@ -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} \
|
||||
|
Loading…
Reference in New Issue
Block a user