Fix artifact upload

This commit is contained in:
Ryan McGuire 2024-12-16 15:21:45 -05:00
parent 555af4beae
commit 3b707cced3

View File

@ -28,13 +28,13 @@ jobs:
- name: Upload Artifact to Gitea
env:
GITEA_ARTIFACT_SERVER: ${GITHUB_SERVER_URL}/api/packages/${GITHUB_REPOSITORY_OWNER}/generic/${PACKAGE_NAME}
API_TOKEN: ${{ secrets.API_TOKEN }} # Replace with a Gitea token stored in repository secrets
run: |
if [ -f ./${BINARY_PATH}/${BINARY_NAME} ]; then
curl -X PUT --user ${GITHUB_REPOSITORY_OWNER}:${API_TOKEN} \
-F "artifact=@./${BINARY_PATH}/${BINARY_NAME}" \
"$GITEA_ARTIFACT_SERVER/${{ github.ref_name }}/${BINARY_NAME}"
curl -X PUT \
-H "Authorization: token ${API_TOKEN}" \
--upload-file ./${BINARY_PATH}/${BINARY_NAME} \
"${GITHUB_SERVER_URL}/api/packages/${GITHUB_REPOSITORY_OWNER}/generic/${PACKAGE_NAME}/${{ github.ref_name }}/${BINARY_NAME}"
else
echo "Error: Binary ./${BINARY_PATH}/${BINARY_NAME} not found."
exit 1