Fix artifact config

This commit is contained in:
Ryan McGuire 2024-12-16 14:32:53 -05:00
parent 42e36af55b
commit 8f8ff64ac2

View File

@ -5,6 +5,7 @@ on:
env:
PACKAGE_NAME: eia-api-go
BINARY_PATH: bin
BINARY_NAME: eia-client
# DOCKER_HOST: "unix:///var/run/user/1000/docker.sock"
# DOCKER_ORG: "rmcguire"
@ -28,12 +29,12 @@ jobs:
- name: Upload Artifact to Gitea
env:
GITEA_ARTIFACT_SERVER: ${GITHUB_SERVER_URL}/api/packages/${GITHUB_REPOSITORY_OWNER}/generic/${PACKAGE_NAME}
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} # Replace with a Gitea token stored in repository secrets
API_TOKEN: ${{ secrets.API_TOKEN }} # Replace with a Gitea token stored in repository secrets
run: |
if [ -f ./eia-client ]; then
curl -X PUT --user ${GITHUB_REPOSITORY_OWNER}:${GITEA_TOKEN} \
-F "artifact=@./eia-client" \
"$GITEA_ARTIFACT_SERVER/${{ github.ref_name }}/eia-client"
curl -X PUT --user ${GITHUB_REPOSITORY_OWNER}:${API_TOKEN} \
-F "artifact=@./${BINARY_PATH}/${BINARY_NAME}" \
"$GITEA_ARTIFACT_SERVER/${{ github.ref_name }}/${BINARY_NAME}"
else
echo "Error: Binary eia-client not found."
exit 1