Compare commits

..

No commits in common. "ae094a566cc3af2a74a06856844743ef93d065ec" and "9f13b9fdf6c451a892aeeafcebf23ad38c74cf5f" have entirely different histories.

View File

@ -8,7 +8,7 @@ env:
BINARY_PATH: bin BINARY_PATH: bin
BINARY_NAME: eia-client BINARY_NAME: eia-client
GO_MOD_PATH: gitea.libretechconsulting.com/50w/eia-api-go GO_MOD_PATH: gitea.libretechconsulting.com/50w/eia-api-go
GO_GIT_HOST: gitea.libretechconsulting.com GOPRIVATE: gitea.libretechconsulting.com/*
# DOCKER_HOST: "unix:///var/run/user/1000/docker.sock" # DOCKER_HOST: "unix:///var/run/user/1000/docker.sock"
# DOCKER_ORG: "rmcguire" # DOCKER_ORG: "rmcguire"
# DOCKER_LATEST: "latest" # DOCKER_LATEST: "latest"
@ -43,23 +43,15 @@ jobs:
fi fi
- name: Generate and Upload Package to Go Registry - name: Generate and Upload Package to Go Registry
env:
GOPRIVATE: gitea.libretechconsulting.com/*
API_TOKEN: ${{ secrets.API_TOKEN }} # Replace with a Gitea token stored in repository secrets
run: | run: |
# Set up netrc for Gitea echo "Generating package archive for ${GO_MOD_PATH}@${{ github.ref_name }}"
echo "machine ${GO_GIT_HOST} login ${GITHUB_REPOSITORY_OWNER} password ${API_TOKEN}" > ~/.netrc go mod tidy -v
chmod 0600 ~/.netrc go mod download --json ${GO_MOD_PATH}@${{ github.ref_name }} > package.json
# Package and get mod info
go mod download -x --json ${GO_MOD_PATH}@${{ github.ref_name }} | tee 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 | tr -d '"' ) ZIPFILE=$( jq .Zip < package.json )
# Upload to Gitea go registry
echo "Uploading go package ${ZIPFILE}" echo "Uploading go package ${ZIPFILE}"
curl -X PUT \ curl -X PUT \
-H "Authorization: token ${API_TOKEN}" \ -H "Authorization: token ${API_TOKEN}" \