From 3add02dfbd082144801a96005b5bb4b668b611ce Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Sun, 11 Aug 2024 21:27:30 -0400 Subject: [PATCH] reattempt --- .forgejo/workflows/build.yaml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.forgejo/workflows/build.yaml b/.forgejo/workflows/build.yaml index 4824fc2..26fa0cb 100644 --- a/.forgejo/workflows/build.yaml +++ b/.forgejo/workflows/build.yaml @@ -48,6 +48,16 @@ jobs: - name: Deploy to repo run: | for apk in $FILELIST; do - echo $APK + branch=$(echo $apk | awk -F '/' '{print $2}') + arch=$(echo $apk | awk -F '/' '{print $3}') + name=$(echo $apk | awk -F '/' '{print $4}') + + echo "Sending $name of arch $arch to $TARGET_REPO/$BASEBRANCH/$branch" + return=$(curl -s --user $FORGE_REPO_USER\:$FORGE_REPO_TOKEN --upload-file $apk $TARGET_REPO/$BASEBRANCH/$branch 2>&1) + if [ "$return" == "package file already exists" ]; then + echo "Package already exists, refreshing..." + curl -s --user $FORGE_REPO_USER\:$FORGE_REPO_TOKEN -X DELETE $TARGET_REPO/$BASEBRANCH/$branch/$arch/$name + curl -s --user $FORGE_REPO_USER\:$FORGE_REPO_TOKEN --upload-file $apk $TARGET_REPO/$BASEBRANCH/$branch + fi done