From c88ec43fcad15db1f92ee85aac452e86a9414a6a Mon Sep 17 00:00:00 2001 From: Ryan D McGuire Date: Mon, 16 Dec 2024 15:55:53 -0500 Subject: [PATCH] Add go package upload --- .gitea/workflows/ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 8c4a115..f9cd82a 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -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} \