diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index d20c75e..30b6a95 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -47,15 +47,19 @@ jobs: GOPRIVATE: gitea.libretechconsulting.com/* API_TOKEN: ${{ secrets.API_TOKEN }} # Replace with a Gitea token stored in repository secrets run: | - go list --json + # Set up netrc for Gitea echo "machine ${GO_GIT_HOST} login ${GITHUB_REPOSITORY_OWNER} password ${API_TOKEN}" > ~/.netrc chmod 0600 ~/.netrc - go mod download -x --json ${GO_MOD_PATH}@${{ github.ref_name }} 2>&1 + + # Package and get mod info + go mod download -x --json ${GO_MOD_PATH}@${{ github.ref_name }} | tee 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 ) + + # Upload to Gitea go registry echo "Uploading go package ${ZIPFILE}" curl -X PUT \ -H "Authorization: token ${API_TOKEN}" \