Skip to content

Commit

Permalink
Update release script (#2631)
Browse files Browse the repository at this point in the history
… mostly to remove the dependence on Hydra
  • Loading branch information
Gabriella439 authored Jan 19, 2025
1 parent 436fe32 commit f16a9e0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 18 deletions.
3 changes: 0 additions & 3 deletions .travis-functions.sh

This file was deleted.

26 changes: 11 additions & 15 deletions scripts/release.sh
Original file line number Diff line number Diff line change
@@ -1,41 +1,37 @@
#! /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"
VERSION="$(get_cabal_version "${NAME}")"

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

0 comments on commit f16a9e0

Please sign in to comment.