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
|
- name: Generate and Upload Package to Go Registry
|
||||||
run: |
|
run: |
|
||||||
ZIPFILE=$( go mod download --json ${GO_MOD_PATH}@${{ github.ref_name }} | jq .Zip )
|
go mod download --json ${GO_MOD_PATH}@${{ github.ref_name }} > package.json
|
||||||
if [ $? -ne 0 ]; then
|
if [[ $? -ne 0 ]]; then
|
||||||
echo "Failed to generage go package archive for ${GO_MOD_PATH}@${{ github.ref_name }}"
|
echo "Failed to generage go package archive for ${GO_MOD_PATH}@${{ github.ref_name }}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
ZIPFILE=$( jq .Zip < package.json )
|
||||||
|
echo "Uploading go package ${ZIPFILE}"
|
||||||
curl -X PUT \
|
curl -X PUT \
|
||||||
-H "Authorization: token ${API_TOKEN}" \
|
-H "Authorization: token ${API_TOKEN}" \
|
||||||
--upload-file ${ZIPFILE} \
|
--upload-file ${ZIPFILE} \
|
||||||
|
Loading…
Reference in New Issue
Block a user