Skip to content

Commit

Permalink
Fix release process
Browse files Browse the repository at this point in the history
  • Loading branch information
doronbehar committed Apr 12, 2023
1 parent 694b47c commit 4190ce0
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions bump-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,23 +55,23 @@ if [ -f VERSION ]; then
echo $INPUT_STRING > VERSION
git add VERSION
git commit -m "Bump version to ${INPUT_STRING}."
git push
git tag -a -m "v$INPUT_STRING" "v$INPUT_STRING"
git push origin --tags "v$INPUT_STRING"
if git status --short | grep -q '*'; then
echo -e "${WARNING_FLAG} Git directory is dirty, refusing to compile pistol-static." >&2
exit 2
fi
nix build -L ".#pistol-static"
nix build -L ".#pistol-static"
echo -e "${NOTICE_FLAG} Checking that the produced executable is not a dynamically linked"
ldd ./result/bin/pistol 2>&1 | grep 'not a dynamic executable'
ldd ./result/bin/pistol 2>&1 | grep 'not a dynamic executable'
echo -e "${NOTICE_FLAG} Checking that the produced executable has the version string compiled into it"
./result/bin/pistol --version | grep $INPUT_STRING
# TODO: Support more executables once cross compilation works.
# https://cli.github.com/manual/gh_release_create
git log --pretty=format:" - %s" "v$INPUT_STRING"...HEAD | gh release create v$INPUT_STRING \
--notes-file - \
'./result/bin/pistol#pistol-x86_64' \
./result/share/man/man1/pistol.1.gz
git push origin --tags
gh release create v$INPUT_STRING --generate-notes \
"./result/bin/pistol#pistol-x86_64" \
./result/share/man/man1/pistol.1.gz \
"$(nix build --print-out-paths --print-build-logs ".#pistol-static-aarch64")/bin/pistol#pistol.aarch64" \
"$(nix build --print-out-paths --print-build-logs ".#pistol-static-armv7l")/bin/pistol#pistol.armv7l"
else
echo -e "${WARNING_FLAG} Could not find a VERSION file." >&2
exit 1
Expand Down

0 comments on commit 4190ce0

Please sign in to comment.