Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update release script #2631

Merged
merged 2 commits into from
Jan 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading