Skip to content

Commit

Permalink
Use nix search to upload releases
Browse files Browse the repository at this point in the history
  • Loading branch information
doronbehar committed Jul 30, 2023
1 parent 799443e commit 15a3b61
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions bump-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,18 @@ if [ -f VERSION ]; then
exit 2
fi
rm -f result
for target in pistol-static-{x86_64,aarch64,armv7l}; do
nix search . pistol-static --json | jq --raw-output 'keys | .[]' | cut -d'.' -f3 | while read target; do
rm -f result-"$target"
nix build --print-build-logs --print-out-paths ".#$target" --out-link result-"$target"
echo -e "${NOTICE_FLAG} Checking that the produced executable is not a dynamically linked"
ldd ./result-"$target"/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"
done
# Test the only executable that we can run that it has a good --version output
./result-pistol-static-x86_64/bin/pistol --version | grep $INPUT_STRING
./result-pistol-static-linux-x86_64/bin/pistol --version | grep $INPUT_STRING
gh release create v$INPUT_STRING --generate-notes \
./result-pistol-static-x86_64/share/man/man1/pistol.1.gz
for target in pistol-static-{x86_64,aarch64,armv7l}; do
./result-pistol-static-linux-x86_64/share/man/man1/pistol.1.gz
nix search . pistol-static --json | jq --raw-output 'keys | .[]' | cut -d'.' -f3 | while read target; do
ln -s result-"$target"/bin/pistol "$target"
gh release upload v$INPUT_STRING "$target"
rm "$target"
Expand Down
20 changes: 10 additions & 10 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@
inherit version src;
};
pistol = pkgs.callPackage ./pkg.nix pkgArgs;
pistol-static-native = pkgs.pkgsStatic.callPackage ./pkg.nix pkgArgs;
pistol-static-x86_64 = pkgs.pkgsCross.gnu64.pkgsStatic.callPackage ./pkg.nix pkgArgs;
pistol-static-aarch64 = pkgs.pkgsCross.aarch64-multiplatform-musl.pkgsStatic.callPackage ./pkg.nix pkgArgs;
pistol-static-armv7l = pkgs.pkgsCross.armv7l-hf-multiplatform.pkgsStatic.callPackage ./pkg.nix pkgArgs;
pistol-static-arm = pkgs.pkgsCross.arm-embedded.pkgsStatic.callPackage ./pkg.nix pkgArgs;
pistol-static-linux-native = pkgs.pkgsStatic.callPackage ./pkg.nix pkgArgs;
pistol-static-linux-x86_64 = pkgs.pkgsCross.gnu64.pkgsStatic.callPackage ./pkg.nix pkgArgs;
pistol-static-linux-aarch64 = pkgs.pkgsCross.aarch64-multiplatform-musl.pkgsStatic.callPackage ./pkg.nix pkgArgs;
pistol-static-linux-armv7l = pkgs.pkgsCross.armv7l-hf-multiplatform.pkgsStatic.callPackage ./pkg.nix pkgArgs;
pistol-static-linux-arm = pkgs.pkgsCross.arm-embedded.pkgsStatic.callPackage ./pkg.nix pkgArgs;
in {
devShell = pkgs.mkShell {
nativeBuildInputs = [
Expand All @@ -83,11 +83,11 @@
packages = {
inherit
pistol
pistol-static-native
pistol-static-x86_64
pistol-static-aarch64
pistol-static-armv7l
pistol-static-arm
pistol-static-linux-native
pistol-static-linux-x86_64
pistol-static-linux-aarch64
pistol-static-linux-armv7l
#pistol-static-linux-arm # Currently broken
;
};
defaultPackage = pistol;
Expand Down

0 comments on commit 15a3b61

Please sign in to comment.