From 24f19270cac17eff8451b9ee492a461e5d833c6e Mon Sep 17 00:00:00 2001 From: Gabriel Gonzalez Date: Sun, 16 Feb 2020 22:45:38 -0800 Subject: [PATCH] Add `cachix` step to `./scripts/release.sh` (#1666) See: https://discourse.dhall-lang.org/t/cookbook-request-simple-dhall-pinning-with-nix-shell/147 --- README.md | 15 ++++++++++----- scripts/release.sh | 8 ++++++++ 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 6c9f600f3..27f35688a 100644 --- a/README.md +++ b/README.md @@ -130,10 +130,15 @@ configuration options to access dhall packages from your declarative configurati ```nix nix = { - binaryCaches = [ "https://cache.nixos.org" "https://cache.dhall-lang.org" ]; + binaryCaches = [ + "https://cache.nixos.org" + "https://cache.dhall-lang.org" + "https://dhall.cachix.org" + ]; binaryCachePublicKeys = [ "cache.dhall-lang.org:I9/H18WHd60olG5GsIjolp7CtepSgJmM2CsO813VTmM=" + "dhall.cachix.org-1:8laGciue2JBwD49ICFtg+cIF8ddDaW7OFBjDb/dHEAo=" ]; }; ``` @@ -145,15 +150,15 @@ regardless of whether you use NixOS, set the following options in your Using Nix 2.0 or later: ``` -trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= cache.dhall-lang.org:I9/H18WHd60olG5GsIjolp7CtepSgJmM2CsO813VTmM= -substituters = https://cache.nixos.org https://cache.dhall-lang.org +trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= cache.dhall-lang.org:I9/H18WHd60olG5GsIjolp7CtepSgJmM2CsO813VTmM= dhall.cachix.org-1:8laGciue2JBwD49ICFtg+cIF8ddDaW7OFBjDb/dHEAo= +substituters = https://cache.nixos.org https://cache.dhall-lang.org https://dhall.cachix.org ``` Using earlier Nix versions (i.e. Nix `1.*`): ``` -binary-cache-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= cache.dhall-lang.org:I9/H18WHd60olG5GsIjolp7CtepSgJmM2CsO813VTmM= -binary-caches = https://cache.nixos.org https://cache.dhall-lang.org +binary-cache-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= cache.dhall-lang.org:I9/H18WHd60olG5GsIjolp7CtepSgJmM2CsO813VTmM= dhall.cachix.org-1:8laGciue2JBwD49ICFtg+cIF8ddDaW7OFBjDb/dHEAo= +binary-caches = https://cache.nixos.org https://cache.dhall-lang.org https://dhall.cachix.org ``` You can build all of the packages by running: diff --git a/scripts/release.sh b/scripts/release.sh index e9894001e..eb98d282f 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -1,3 +1,6 @@ +#! /usr/bin/env nix-shell +#! nix-shell -i bash --packages bash cabal-install cachix curl git skopeo + set -eux JOBSET=master @@ -12,8 +15,13 @@ function release { cabal v1-configure --disable-tests --disable-benchmarks cabal v1-sdist cabal upload --publish "dist/${NAME}-${VERSION}.tar.gz" + git clean --force -d -x . popd + nix build --file ./default.nix "${NAME}" + + cachix push dhall result + curl --location --output "${NAME}-${VERSION}-x86_64-linux.tar.bz2" "https://hydra.dhall-lang.org/job/dhall-haskell/${JOBSET}/tarball-${NAME}/latest/download/1/${NAME}.tar.bz2" curl --location --remote-name "https://hydra.dhall-lang.org/job/dhall-haskell/${JOBSET}/image-${NAME}/latest/download/1/docker-image-${NAME}.tar.gz"