~singpolyma/jmp-pay

91fb350225d40ef6d6342422e2d6f8dce41347fb — Christopher Vollick 1 year, 4 months ago 7c850ab
Modernize CI

This was very complicated... I took the build definition from
jmp-register, and I replaced everywhere I saw jmp-register with jmp-pay.

Oh, and made it point at the right repo.
Crafty, huh!?
1 files changed, 20 insertions(+), 31 deletions(-)

M .builds/guix.yml
M .builds/guix.yml => .builds/guix.yml +20 -31
@@ 1,45 1,34 @@
image: debian/unstable
image: guix
packages:
- plzip
sources:
- https://git.singpolyma.net/jmp-pay
packages:
- guix
- xz-utils
environment:
  GUIX_PROFILE: /var/guix/profiles/per-user/root/guix-profile
  CID: QmRpV6qo68sC3ZCwdZT4qcARw5jUWM6ixSEyxv5ojkhVca
  TARNAME: 2kld8phgqyr21daa2j4aq3nv4zmmrm2y-guix-tarball-pack.tar.xz
secrets:
- 9ded4157-4cf9-42ae-b7d0-55eb6e52ea37
- fd52c9ce-04e8-4684-af6c-1ab78d2e124a
artifacts:
- jmp-pay.scm
- jmp-pay.nar.xz
- jmp-pay.nar.lz
tasks:
- pull: |
    curl -O https://cloudflare-ipfs.com/ipfs/$CID/$TARNAME
    sudo systemctl stop guix-daemon
    sudo tar -C / -xJf $TARNAME
    sudo /sbin/start-stop-daemon -Sbmp /tmp/guix-daemon.pid -a $GUIX_PROFILE/bin/guix-daemon -- --build-users-group=_guixbuild
- bake: |
    . $GUIX_PROFILE/etc/profile
    hash guix
    sed '/^;;;;$/q' jmp-pay/jmp-pay.scm > jmp-pay.scm
    printf "(define-module (jmp-pay))\n" > jmp-pay.scm
    sed '/^;;;;$/q' jmp-pay/guix.scm >> jmp-pay.scm
    printf "(define-public jmp-pay\n\t" >> jmp-pay.scm
    cd jmp-pay
    printf "(use-modules (jmp-pay))\n(write jmp-pay-baked)\n" | guix repl -L. /dev/stdin >> ../jmp-pay.scm
    printf '(load "%s/guix.scm")\n(write jmp-pay-baked)\n' "$(pwd)" | guix repl /dev/stdin >> ../jmp-pay.scm
    cd -
    printf ")" >> jmp-pay.scm
    rm -rf jmp-pay
    printf ")\n" >> jmp-pay.scm
    rm -f jmp-pay/guix.scm
    [ "$BUILD_REASON" = patchset ] || rm -rf jmp-pay
- build: |
    . "$GUIX_PROFILE/etc/profile"
    hash guix
    guix build --no-grafts -L. jmp-pay
    if [ "$BUILD_REASON" = patchset ]; then with_source="--with-source=$PWD/jmp-pay"; fi
    guix build $with_source --no-grafts -r out -L. jmp-pay
- archive: |
    . "$GUIX_PROFILE/etc/profile"
    hash guix
    sudo mv signing-key.pub /etc/guix/
    sudo mv signing-key.sec /etc/guix/
    sudo chown root:root /etc/guix/signing-key.sec
    sudo chmod 0400 /etc/guix/signing-key.sec
    guix archive --export -r --no-grafts -L. jmp-pay > jmp-pay.nar
    xz jmp-pay.nar
    if [ -e signing-key.sec ]; then
      sudo mv signing-key.pub /etc/guix/
      sudo mv signing-key.sec /etc/guix/
      sudo chown root:root /etc/guix/signing-key.sec
      sudo chmod 0400 /etc/guix/signing-key.sec
    fi
    guix archive --export -r --no-grafts $(readlink -f out) > jmp-pay.nar
    plzip jmp-pay.nar