forgejo-ci: deploy to $branch-testing when PR is a WIP
This commit is contained in:
parent
77dc41c8aa
commit
5fe2d0a78b
3 changed files with 21 additions and 2 deletions
|
@ -14,6 +14,14 @@ for apk in $apkgs; do
|
||||||
arch=$(echo $apk | awk -F '/' '{print $3}')
|
arch=$(echo $apk | awk -F '/' '{print $3}')
|
||||||
name=$(echo $apk | awk -F '/' '{print $4}')
|
name=$(echo $apk | awk -F '/' '{print $4}')
|
||||||
|
|
||||||
|
if [ "$(curl -s $GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/pulls/$GITHUB_EVENT_NUMBER | jq .draft)" == "true" ]; then
|
||||||
|
# if draft, send to -testing branch
|
||||||
|
branch="$branch-testing"
|
||||||
|
else
|
||||||
|
# if not draft, assume that this was sent to $branch-testing and nuke it
|
||||||
|
curl -s --user $FORGE_REPO_USER:$FORGE_REPO_TOKEN -X DELETE $TARGET_REPO/$BASEBRANCH/$branch-testing/$arch/$name
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Sending $name of arch $arch to $TARGET_REPO/$BASEBRANCH/$branch"
|
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)
|
return=$(curl -s --user $FORGE_REPO_USER:$FORGE_REPO_TOKEN --upload-file $apk $TARGET_REPO/$BASEBRANCH/$branch 2>&1)
|
||||||
echo $return
|
echo $return
|
||||||
|
|
|
@ -2,6 +2,10 @@ on:
|
||||||
pull_request:
|
pull_request:
|
||||||
types: [ assigned, opened, synchronize, reopened ]
|
types: [ assigned, opened, synchronize, reopened ]
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.head_ref || github.ref_name }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-aarch64:
|
build-aarch64:
|
||||||
runs-on: aarch64
|
runs-on: aarch64
|
||||||
|
@ -41,9 +45,10 @@ jobs:
|
||||||
CI_ALPINE_REPO: 'https://ayakael.net/api/packages/forge/alpine'
|
CI_ALPINE_REPO: 'https://ayakael.net/api/packages/forge/alpine'
|
||||||
FORGE_REPO_TOKEN: ${{ secrets.FORGE_REPO_TOKEN }}
|
FORGE_REPO_TOKEN: ${{ secrets.FORGE_REPO_TOKEN }}
|
||||||
FORGE_REPO_USER: ${{ vars.FORGE_REPO_USER }}
|
FORGE_REPO_USER: ${{ vars.FORGE_REPO_USER }}
|
||||||
|
GITHUB_EVENT_NUMBER: ${{ github.event.number }}
|
||||||
steps:
|
steps:
|
||||||
- name: Setting up environment
|
- name: Setting up environment
|
||||||
run: apk add nodejs curl findutils git gawk
|
run: apk add nodejs curl findutils git gawk jq
|
||||||
- name: Repo pull
|
- name: Repo pull
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
- name: Package download
|
- name: Package download
|
||||||
|
|
|
@ -2,6 +2,10 @@ on:
|
||||||
pull_request:
|
pull_request:
|
||||||
types: [ assigned, opened, synchronize, reopened ]
|
types: [ assigned, opened, synchronize, reopened ]
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.head_ref || github.ref_name }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-x86_64:
|
build-x86_64:
|
||||||
runs-on: x86_64
|
runs-on: x86_64
|
||||||
|
@ -41,12 +45,14 @@ jobs:
|
||||||
CI_ALPINE_REPO: 'https://ayakael.net/api/packages/forge/alpine'
|
CI_ALPINE_REPO: 'https://ayakael.net/api/packages/forge/alpine'
|
||||||
FORGE_REPO_TOKEN: ${{ secrets.FORGE_REPO_TOKEN }}
|
FORGE_REPO_TOKEN: ${{ secrets.FORGE_REPO_TOKEN }}
|
||||||
FORGE_REPO_USER: ${{ vars.FORGE_REPO_USER }}
|
FORGE_REPO_USER: ${{ vars.FORGE_REPO_USER }}
|
||||||
|
GITHUB_EVENT_NUMBER: ${{ github.event.number }}
|
||||||
steps:
|
steps:
|
||||||
- name: Setting up environment
|
- name: Setting up environment
|
||||||
run: apk add nodejs curl findutils git gawk
|
run: apk add nodejs curl findutils git gawk jq
|
||||||
- name: Repo pull
|
- name: Repo pull
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
- name: Package download
|
- name: Package download
|
||||||
uses: forgejo/download-artifact@v3
|
uses: forgejo/download-artifact@v3
|
||||||
- name: Package deployment
|
- name: Package deployment
|
||||||
run: ${{ github.workspace }}/.forgejo/bin/deploy.sh
|
run: ${{ github.workspace }}/.forgejo/bin/deploy.sh
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue