Skip to content
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
20 changes: 15 additions & 5 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
pkgs.gnused
pkgs.jq
];
text = builtins.readFile ./release-tools/bump-changelogs.sh;
text = builtins.readFile ./release-tools/bump-changelogs.bash;
};

x52-update-release-notes = pkgs.writeShellApplication {
Expand All @@ -64,7 +64,7 @@
pkgs.git
pkgs.jq
];
text = builtins.readFile ./release-tools/update-release-notes.sh;
text = builtins.readFile ./release-tools/update-release-notes.bash;
};

x52-comment-release-pr = pkgs.writeShellApplication {
Expand All @@ -74,7 +74,7 @@
pkgs.gh
pkgs.jq
];
text = builtins.readFile ./release-tools/comment-release-pr.sh;
text = builtins.readFile ./release-tools/comment-release-pr.bash;
};

x52-comment-release-assets-uploaded = pkgs.writeShellApplication {
Expand All @@ -84,7 +84,7 @@
pkgs.gh
pkgs.jq
];
text = builtins.readFile ./release-tools/comment-release-assets-uploaded.sh;
text = builtins.readFile ./release-tools/comment-release-assets-uploaded.bash;
};

x52-release-tools = pkgs.symlinkJoin {
Expand Down Expand Up @@ -117,7 +117,17 @@
BASH_BIN = "${pkgs.bash}/bin/bash";
}
''
bash ${./release-tools/test.sh}
bash ${./release-tools/test.bash}
touch "$out"
'';

shellcheck =
pkgs.runCommand "check-shellcheck"
{
nativeBuildInputs = [ pkgs.shellcheck ];
}
''
shellcheck ${./release-tools}/*.bash
touch "$out"
'';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
set -eEuo pipefail
shopt -s inherit_errexit

release_plz_pr_json="${RELEASE_PLZ_PR_JSON:?RELEASE_PLZ_PR_JSON is required}"
cargo_bin="${X52_CARGO:-cargo}"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
set -eEuo pipefail
shopt -s inherit_errexit

release_plz_releases_json="${1:?release-plz releases JSON is required}"
marker="<!-- x52-release-assets-uploaded -->"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
set -eEuo pipefail
shopt -s inherit_errexit

release_plz_releases_json="${1:?release-plz releases JSON is required}"
marker="<!-- x52-draft-release-link -->"
Expand Down
4 changes: 4 additions & 0 deletions release-tools/test.sh → release-tools/test.bash
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
set -euo pipefail
shopt -s inherit_errexit

test_root="$(mktemp -d)"
trap 'rm -rf "$test_root"' EXIT
Expand Down Expand Up @@ -36,13 +37,15 @@ EOF
printf '#!%s\n' "$bash_bin" >"$fake_bin/cargo"
cat >>"$fake_bin/cargo" <<'EOF'
set -euo pipefail
shopt -s inherit_errexit
[[ "$*" == "metadata --format-version=1 --no-deps" ]]
printf '{"packages":[{"name":"demo","manifest_path":"%s/Cargo.toml"}]}\n' "$FIXTURE_ROOT"
EOF

printf '#!%s\n' "$bash_bin" >"$fake_bin/gh"
cat >>"$fake_bin/gh" <<'EOF'
set -euo pipefail
shopt -s inherit_errexit
printf 'gh' >>"$COMMAND_LOG"
printf ' <%s>' "$@" >>"$COMMAND_LOG"
printf '\n' >>"$COMMAND_LOG"
Expand Down Expand Up @@ -84,6 +87,7 @@ EOF
printf '#!%s\n' "$bash_bin" >"$fake_bin/git"
cat >>"$fake_bin/git" <<'EOF'
set -euo pipefail
shopt -s inherit_errexit
if [[ "$*" == "diff --cached --quiet" ]]; then
exit 1
fi
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
set -eEuo pipefail
shopt -s inherit_errexit

release_plz_releases_json="${RELEASE_PLZ_RELEASES_JSON:?RELEASE_PLZ_RELEASES_JSON is required}"
cargo_bin="${X52_CARGO:-cargo}"
Expand Down
Loading