Skip to content

Commit

Permalink
ask whether to run tests in release script
Browse files Browse the repository at this point in the history
  • Loading branch information
tek committed Sep 2, 2023
1 parent b57632a commit ade74e8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 18 deletions.
4 changes: 1 addition & 3 deletions lib/hackage.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
33 changes: 18 additions & 15 deletions lib/release.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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" ''
Expand Down

0 comments on commit ade74e8

Please sign in to comment.