fix deploy script
Some checks failed
/ build-x86_64 (pull_request) Successful in 41s
/ deploy (pull_request) Failing after 24s
/ lint (pull_request) Successful in 23s

This commit is contained in:
Antoine Martin 2024-08-11 21:02:48 -04:00
parent 33c2d766d9
commit bf8c39638c
Signed by: forge
GPG key ID: D62A472A4AA7D541
2 changed files with 18 additions and 2 deletions

View file

@ -6,6 +6,21 @@ set -eu -o pipefail
readonly APORTSDIR=$GITHUB_WORKSPACE
readonly REPOS="backports user"
readonly BASEBRANCH=$GITHUB_BASE_REF
readonly TARGET_REPO=$CI_ALPINE_REPO
find package -type f -name "*.apk"
apkgs=$(find package -type f -name "*.apk")
for apk in $apkgs; do
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 --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, deleting and resending"
curl --user $FORGE_REPO_USER:$FORGE_REPO_TOKEN -X DELETE $TARGET_REPO/$BASEBRANCH/$branch/$arch/$name
curl --user $FORGE_REPO_USER:$FORGE_REPO_TOKEN --upload-file $apk $TARGET_REPO/$BASEBRANCH/$branch
fi
done

View file

@ -12,6 +12,7 @@ jobs:
CI_DEBUG_BUILD: ${{ runner.debug }}
CI_MERGE_REQUEST_PROJECT_URL: ${{ github.server_url }}/${{ github.repository }}
CI_MERGE_REQUEST_TARGET_BRANCH_NAME: ${{ github.base_ref }}
CI_ALPINE_REPO: 'https://ayakael.net/api/packages/forge/alpine'
steps:
- run: doas apk add nodejs git patch
- run: doas wget -P /etc/apk/keys 'https://ayakael.net/pkgs/apk/raw/branch/edge/antoine.martin@protonmail.com-5b3109ad.rsa.pub'
@ -30,7 +31,7 @@ jobs:
container:
image: alpine:latest
steps:
- run: apk add nodejs curl findutils git
- run: apk add nodejs curl findutils git gawk
- uses: actions/checkout@v4
- uses: forgejo/download-artifact@v4
- name: Deploy to repo