fix deploy script
This commit is contained in:
parent
33c2d766d9
commit
bf8c39638c
2 changed files with 18 additions and 2 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue