mirror of
https://github.com/ps5-linux/ps5-linux-image.git
synced 2026-07-15 21:42:27 +00:00
add CI trigger workflow
This commit is contained in:
18
.github/workflows/dispatch.yml
vendored
18
.github/workflows/dispatch.yml
vendored
@@ -1,18 +0,0 @@
|
||||
name: Dispatch to CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
dispatch:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Send repository_dispatch
|
||||
uses: peter-evans/repository-dispatch@v3
|
||||
with:
|
||||
token: ${{ secrets.DISPATCH_TOKEN }}
|
||||
repository: ps5-linux/ps5-linux-updates
|
||||
event-type: image-builder-updated
|
||||
client-payload: '{"sha": "${{ github.sha }}"}'
|
||||
33
.github/workflows/trigger-builds.yml
vendored
Normal file
33
.github/workflows/trigger-builds.yml
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
name: deploy
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
kernel:
|
||||
permissions:
|
||||
contents: write
|
||||
uses: ps5-linux/ps5-linux-updates/.github/workflows/build-kernel.yml@main
|
||||
secrets:
|
||||
DISPATCH_TOKEN: ${{ secrets.DISPATCH_TOKEN }}
|
||||
REMOTE_SSH_KEY: ${{ secrets.REMOTE_SSH_KEY }}
|
||||
REMOTE_SSH_CONFIG: ${{ secrets.REMOTE_SSH_CONFIG }}
|
||||
REMOTE_SSH_KNOWN_HOSTS: ${{ secrets.REMOTE_SSH_KNOWN_HOSTS }}
|
||||
|
||||
image:
|
||||
permissions:
|
||||
contents: write
|
||||
uses: ps5-linux/ps5-linux-updates/.github/workflows/build-image.yml@main
|
||||
with:
|
||||
distro: all
|
||||
secrets:
|
||||
DISPATCH_TOKEN: ${{ secrets.DISPATCH_TOKEN }}
|
||||
REMOTE_SSH_KEY: ${{ secrets.REMOTE_SSH_KEY }}
|
||||
REMOTE_SSH_CONFIG: ${{ secrets.REMOTE_SSH_CONFIG }}
|
||||
REMOTE_SSH_KNOWN_HOSTS: ${{ secrets.REMOTE_SSH_KNOWN_HOSTS }}
|
||||
R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
|
||||
R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
|
||||
R2_ENDPOINT: ${{ secrets.R2_ENDPOINT }}
|
||||
R2_BUCKET: ${{ secrets.R2_BUCKET }}
|
||||
|
||||
@@ -21,6 +21,7 @@ usage() {
|
||||
echo " --kernel Path to kernel source directory (default: auto-clone to work/linux/)"
|
||||
echo " --img-size Disk image size in MB (default: 12000, 32000 for --distro all)"
|
||||
echo " --clean Remove all cached build artifacts and start from scratch"
|
||||
echo " --clean-only Remove all cached build artifacts and exit"
|
||||
echo " --kernel-only Build and package the kernel only, then exit"
|
||||
echo " --patches-ref Branch, tag, or commit SHA for patches (default: v1.0)"
|
||||
exit 1
|
||||
@@ -32,6 +33,7 @@ while [[ $# -gt 0 ]]; do
|
||||
--kernel) KERNEL_SRC="$2"; shift 2 ;;
|
||||
--img-size) IMG_SIZE="$2"; shift 2 ;;
|
||||
--clean) CLEAN=true; shift ;;
|
||||
--clean-only) CLEAN=true; CLEAN_EXIT=true; shift ;;
|
||||
--kernel-only) KERNEL_ONLY=true; shift ;;
|
||||
--patches-ref) [ -n "$2" ] && PATCHES_REF="$2"; shift 2 ;;
|
||||
-h|--help) usage ;;
|
||||
@@ -76,14 +78,14 @@ esac
|
||||
BUILD_PID=""
|
||||
|
||||
cleanup() {
|
||||
trap - INT TERM EXIT
|
||||
echo ""
|
||||
echo "Interrupted. Cleaning up..."
|
||||
echo "Cleaning up..."
|
||||
docker kill "$DOCKER_NAME" 2>/dev/null || true
|
||||
[ -n "$BUILD_PID" ] && kill "$BUILD_PID" 2>/dev/null || true
|
||||
wait "$BUILD_PID" 2>/dev/null || true
|
||||
exit 130
|
||||
}
|
||||
trap cleanup INT TERM
|
||||
trap cleanup INT TERM EXIT
|
||||
|
||||
# --- Clean ---
|
||||
if [ "$CLEAN" = true ]; then
|
||||
@@ -94,6 +96,7 @@ if [ "$CLEAN" = true ]; then
|
||||
alpine rm -rf "/parent/$(basename "$dir")"
|
||||
done
|
||||
echo "Done."
|
||||
[ "$CLEAN_EXIT" = true ] && exit 0
|
||||
echo ""
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user