diff --git a/.travis-functions.sh b/.travis-functions.sh deleted file mode 100644 index 3c66d0de6..000000000 --- a/.travis-functions.sh +++ /dev/null @@ -1,3 +0,0 @@ -get_cabal_version() { grep '^Version: ' < "$1/$1.cabal" | sed -e 's/^Version: *//g'; } - -mk_release_name() { echo "$1-$(get_cabal_version "$1")-x86_64-macos.tar.bz2"; } diff --git a/scripts/release.sh b/scripts/release.sh index cfd1675f5..e60e86986 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -1,11 +1,11 @@ #! /usr/bin/env nix-shell -#! nix-shell -i bash --packages bash cabal-install cachix curl git skopeo +#! nix-shell -i bash --packages bash cabal-install cachix git skopeo ghc set -eux -JOBSET=master - -. .travis-functions.sh +get_cabal_version() { + grep '^Version: ' < "$1/$1.cabal" | sed -e 's/^Version: *//g'; +} function release { NAME="$1" @@ -13,29 +13,25 @@ function release { pushd "${NAME}" cabal sdist - cabal upload --publish "../dist-newstyle/sdist/${NAME}-${VERSION}.tar.gz" - git clean --force -d -x . + cabal upload --publish "../dist-newstyle/sdist/${NAME}-${VERSION}.tar.gz" || : popd - nix build --file ./default.nix "${NAME}" - - cachix push dhall result + BUILD="$(nix build --file ./default.nix "${NAME}" --print-out-paths)" - 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" + cachix push dhall "${BUILD}" - DOCKER_ARCHIVE="docker-image-${NAME}.tar.gz" - - curl --location --remote-name "https://hydra.dhall-lang.org/job/dhall-haskell/${JOBSET}/image-${NAME}/latest/download/1/${DOCKER_ARCHIVE}" + DOCKER_ARCHIVE_DIRECTORY="$(nix build --file ./release.nix "image-${NAME}" --print-out-paths)" + DOCKER_ARCHIVE="${DOCKER_ARCHIVE_DIRECTORY}/docker-image-${NAME}.tar.gz" skopeo copy --insecure-policy --dest-creds="gabriel439:$(< dockerPassword.txt)" "docker-archive:${DOCKER_ARCHIVE}" "docker://dhallhaskell/${NAME}" skopeo copy --insecure-policy --dest-creds="gabriel439:$(< dockerPassword.txt)" "docker-archive:${DOCKER_ARCHIVE}" "docker://dhallhaskell/${NAME}:${VERSION}" - - rm "${DOCKER_ARCHIVE}" } git submodule update +git clean --force -d -x -- dhall* + for package in dhall-lsp-server dhall-openapi dhall-toml dhall-csv dhall-json dhall-yaml dhall-bash dhall-nix dhall-nixpkgs dhall-docs dhall; do release "${package}" done