~xdavidwu/apkbuilds

aaa7285305ce17adb7e9c84ae8a8ef2dc93253ea — xdavidwu 2 years ago 4cde4f2
add sourcehut build scripts
2 files changed, 37 insertions(+), 0 deletions(-)

A build.yml
A submit-build
A build.yml => build.yml +31 -0
@@ 0,0 1,31 @@
image: alpine/edge
repositories:
packages:
  - alpine-sdk
environment:
  source: apkbuilds
  release: edge
  repo: xdavidwu
  key: Egloga-Alpine-AUTOMATED-CI-61864ad2.rsa
  package: changeme
sources:
  - https://git.xdavidwu.link/~xdavidwu/systemd-apkbuilds
secrets:
  - f288c06f-779e-4a47-8d35-b9b51283fbc7
  - 777c5ba2-1eb8-441f-b111-c8c608419a57
tasks:
  - prepare: |
      cat <<EOF > ~/.abuild/abuild.conf
      PACKAGER="builds.xdavidwu.link <xdavidwuph@gmail.com>"
      PACKAGER_PRIVKEY="$HOME/.abuild/$key"
      EOF
  - build: |
      cd "$source/$package"
      abuild -rK
  - deploy: |
      arch=$(uname -m)
      echo "StrictHostKeyChecking=no" >> ~/.ssh/config
      for file in "packages/$source/$arch"/*.apk; do
        name=$(basename "$file")
        ssh deploy@alpine.xdavidwu.link "$release/$repo/$arch/$name" < "$file"
      done

A submit-build => submit-build +6 -0
@@ 0,0 1,6 @@
#!/bin/sh
set -e

pkg=$(basename "$1")
. "$pkg"/APKBUILD
yq ".environment.package = \"$pkg\"" < build.yml | ssh builds@builds.xdavidwu.link "submit -n$pkgname\ $pkgver-$pkgrel"