diff --git a/lib/hackage.nix b/lib/hackage.nix index f8be373a..67dfea7b 100644 --- a/lib/hackage.nix +++ b/lib/hackage.nix @@ -14,11 +14,9 @@ let allCabals = concatMapStringsSep " " (n: "${config.internal.relativePackages.${n}}/${n}.cabal") allTargets; - mapLines = concatMapStringsSep "\n"; - confirm = type: '' print -n ">>> Upload ${type} now? [yN] " - read -q decision + read -q decision || true print "" if [[ $decision != 'y' ]] then diff --git a/lib/release.nix b/lib/release.nix index ad37621d..8edbae47 100644 --- a/lib/release.nix +++ b/lib/release.nix @@ -2,15 +2,25 @@ inherit (config.internal) pkgs; - commitAndTag = '' - ${pkgs.git}/bin/git commit --allow-empty -m "Release $version" - ${pkgs.git}/bin/git tag -m "Release $version" "$version" + preamble = '' + #!${pkgs.zsh}/bin/zsh + setopt err_exit no_unset pipefail + + if [[ $# == 0 ]] + then + echo 'Please specify version' + exit 1 + fi + version="$1" ''; updateVersions = '' - nix build .#docs - if [[ -z ''${hix_release_skip_test-} ]] + echo -n ">>> Run tests? [Yn] " + read -q decision || true + echo "" + if [[ $decision != 'n' ]] then + nix build .#docs nix run .#test fi sed -i 's/ref=[^"#]\+/ref='"$version/" readme.md examples/*/flake.nix @@ -20,16 +30,9 @@ ${pkgs.git}/bin/git add readme.md changelog.md examples modules/basic.nix ''; - preamble = '' - #!${pkgs.zsh}/bin/zsh - setopt err_exit no_unset pipefail - - if [[ $# == 0 ]] - then - echo 'Please specify version' - exit 1 - fi - version="$1" + commitAndTag = '' + ${pkgs.git}/bin/git commit --allow-empty -m "Release $version" + ${pkgs.git}/bin/git tag -m "Release $version" "$version" ''; nix = pkgs.writeScript "hix-release-nix" ''