Skip to content

Commit

Permalink
Merge pull request #1261 from michalbiesek/main
Browse files Browse the repository at this point in the history
RFC: simplify adding new arch in build process
  • Loading branch information
rhatdan authored Aug 8, 2023
2 parents 81896b2 + 57a252b commit e2e7b62
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 52 deletions.
12 changes: 4 additions & 8 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,10 @@ jobs:
- run: |
sudo mv release-* /tmp/artifact
sudo mv /tmp/artifact/crun-*-linux-amd64 /tmp/artifact/crun-linux-amd64
sudo mv /tmp/artifact/crun-*-linux-amd64-disable-systemd /tmp/artifact/crun-linux-amd64-disable-systemd
sudo mv /tmp/artifact/crun-*-linux-arm64 /tmp/artifact/crun-linux-arm64
sudo mv /tmp/artifact/crun-*-linux-arm64-disable-systemd /tmp/artifact/crun-linux-arm64-disable-systemd
sudo mv /tmp/artifact/crun-*-linux-ppc64le /tmp/artifact/crun-linux-ppc64le
sudo mv /tmp/artifact/crun-*-linux-ppc64le-disable-systemd /tmp/artifact/crun-linux-ppc64le-disable-systemd
sudo mv /tmp/artifact/crun-*-linux-riscv64 /tmp/artifact/crun-linux-riscv64
sudo mv /tmp/artifact/crun-*-linux-riscv64-disable-systemd /tmp/artifact/crun-linux-riscv64-disable-systemd
for ARCH in amd64 arm64 ppc64le riscv64; do
sudo mv /tmp/artifact/crun-*-linux-${ARCH} /tmp/artifact/crun-linux-${ARCH}
sudo mv /tmp/artifact/crun-*-linux-${ARCH}-disable-systemd /tmp/artifact/crun-linux-${ARCH}-disable-systemd
done
sudo mv /tmp/artifact/*.tar.gz /tmp/artifact/crun.tar.gz
sudo mv /tmp/artifact/*.tar.xz /tmp/artifact/crun.tar.xz
(cd /tmp/artifact; sha256sum * | sudo tee CHECKSUMS)
Expand Down
54 changes: 10 additions & 44 deletions build-aux/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,53 +45,19 @@ mkdir -p /nix

NIX_ARGS="--extra-experimental-features nix-command --print-build-logs --option cores $(nproc) --option max-jobs $(nproc)"

$RUNTIME run --rm $RUNTIME_EXTRA_ARGS --privileged -v /nix:/nix -v ${PWD}:${PWD} -w ${PWD} ${NIX_IMAGE} \
nix $NIX_ARGS build --file nix/
cp ./result/bin/crun $OUTDIR/crun-$VERSION-linux-amd64
for ARCH in amd64 arm64 ppc64le riscv64; do
$RUNTIME run --rm $RUNTIME_EXTRA_ARGS --privileged -v /nix:/nix -v ${PWD}:${PWD} -w ${PWD} ${NIX_IMAGE} \
nix $NIX_ARGS build --file nix/default-${ARCH}.nix
cp ./result/bin/crun $OUTDIR/crun-$VERSION-linux-${ARCH}

rm -rf result
rm -rf result

$RUNTIME run --rm $RUNTIME_EXTRA_ARGS --privileged -v /nix:/nix -v ${PWD}:${PWD} -w ${PWD} ${NIX_IMAGE} \
nix $NIX_ARGS build --file nix/ --arg enableSystemd false
cp ./result/bin/crun $OUTDIR/crun-$VERSION-linux-amd64-disable-systemd
$RUNTIME run --rm $RUNTIME_EXTRA_ARGS --privileged -v /nix:/nix -v ${PWD}:${PWD} -w ${PWD} ${NIX_IMAGE} \
nix $NIX_ARGS build --file nix/default-${ARCH}.nix --arg enableSystemd false
cp ./result/bin/crun $OUTDIR/crun-$VERSION-linux-${ARCH}-disable-systemd

rm -rf result

$RUNTIME run --rm $RUNTIME_EXTRA_ARGS --privileged -v /nix:/nix -v ${PWD}:${PWD} -w ${PWD} ${NIX_IMAGE} \
nix $NIX_ARGS build --file nix/default-arm64.nix
cp ./result/bin/crun $OUTDIR/crun-$VERSION-linux-arm64

rm -rf result

$RUNTIME run --rm $RUNTIME_EXTRA_ARGS --privileged -v /nix:/nix -v ${PWD}:${PWD} -w ${PWD} ${NIX_IMAGE} \
nix $NIX_ARGS build --file nix/default-arm64.nix --arg enableSystemd false
cp ./result/bin/crun $OUTDIR/crun-$VERSION-linux-arm64-disable-systemd

rm -rf result

$RUNTIME run --rm $RUNTIME_EXTRA_ARGS --privileged -v /nix:/nix -v ${PWD}:${PWD} -w ${PWD} ${NIX_IMAGE} \
nix $NIX_ARGS build --file nix/default-ppc64le.nix
cp ./result/bin/crun $OUTDIR/crun-$VERSION-linux-ppc64le

rm -rf result

$RUNTIME run --rm $RUNTIME_EXTRA_ARGS --privileged -v /nix:/nix -v ${PWD}:${PWD} -w ${PWD} ${NIX_IMAGE} \
nix $NIX_ARGS build --file nix/default-ppc64le.nix --arg enableSystemd false
cp ./result/bin/crun $OUTDIR/crun-$VERSION-linux-ppc64le-disable-systemd

rm -rf result

$RUNTIME run --rm $RUNTIME_EXTRA_ARGS --privileged -v /nix:/nix -v ${PWD}:${PWD} -w ${PWD} ${NIX_IMAGE} \
nix $NIX_ARGS build --file nix/default-riscv64.nix
cp ./result/bin/crun $OUTDIR/crun-$VERSION-linux-riscv64

rm -rf result

$RUNTIME run --rm $RUNTIME_EXTRA_ARGS --privileged -v /nix:/nix -v ${PWD}:${PWD} -w ${PWD} ${NIX_IMAGE} \
nix $NIX_ARGS build --file nix/default-riscv64.nix --arg enableSystemd false
cp ./result/bin/crun $OUTDIR/crun-$VERSION-linux-riscv64-disable-systemd

rm -rf result
rm -rf result
done

if test x$SKIP_GPG = x; then
for i in $OUTDIR/*; do
Expand Down
File renamed without changes.

0 comments on commit e2e7b62

Please sign in to comment.