Skip to content

Commit 49a82eb

Browse files
committed
version 0.2.30
1 parent cdccb18 commit 49a82eb

File tree

5 files changed

+68
-23
lines changed

5 files changed

+68
-23
lines changed

.aliases/dev-upload-to-github

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,52 @@
11
#! /usr/bin/env nix-shell
22
#! nix-shell -i bash -p jq github-cli
33

4-
set -e
4+
set -eo pipefail
5+
6+
SCRIPTDIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
7+
cd "$SCRIPTDIR"
8+
9+
. ./util.sh
10+
11+
cd ..
512

613
for arg do
714
shift
815

9-
[ "$arg" = "--dry-run" ] && DRY_RUN=t && continue
16+
[ "$arg" = "--grand" ] && GRAND="t" && continue
1017
done
1118

12-
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
13-
cd "$SCRIPTDIR/.."
19+
if [[ -n "$GRAND" ]]; then
20+
BUILT=$(nix build .#grandCombinedGithubArtifacts \
21+
--builders-use-substitutes --no-link --json | jq -r '.[0].outputs.out')
22+
else
23+
BUILT=$(nix build .#githubArtifacts --no-link --json | jq -r '.[0].outputs.out')
24+
fi
1425

15-
BUILT=$(nix build .#packaged --no-link --json | jq -r '.[0].outputs.out')
16-
echo "Built:"
17-
ls -lh "$BUILT"
26+
echo "Built: $BUILT"
27+
ls "$BUILT"
1828

1929
VERSION="$(nix eval .#default.version --raw)"
30+
echo "Got version: $VERSION"
2031

21-
ARTIFACT_LINUX="$BUILT/rust-notebook-language-server-$VERSION-x86_64-linux"
22-
ARTIFACT_LINUX_ARCHIVE="$ARTIFACT_LINUX.tar.gz"
32+
IFS=$'\n'
33+
ARTIFACTS=$(find "$BUILT" -name "*.tar.gz")
34+
unset IFS
35+
echo "Saw artifacts:\n\n"
36+
echo "$ARTIFACTS"
2337

2438
# Smoke check
25-
$ARTIFACT_LINUX --help 2>&1 > /dev/null
39+
# FIRST_EXECUTABLE=$(find "$BUILT" -type f -executable | head -n 1)
40+
# echo "FIRST_EXECUTABLE: $FIRST_EXECUTABLE"
41+
# $FIRST_EXECUTABLE --help > /dev/null 2>&1
2642

27-
echo "Got artifact: $ARTIFACT_LINUX"
43+
TAG=v"$VERSION"
2844

29-
if [[ -n "$DRY_RUN" ]]; then
30-
exit $?
31-
fi
45+
echo ""
46+
echo "This will tag the current commit as $TAG and upload the above aliases to Git."
47+
echo ""
48+
confirm_execution
3249

33-
TAG=v"$VERSION"
3450
echo "Tagging at $TAG"
3551
git tag "$TAG" -f
3652
echo ""
@@ -41,6 +57,6 @@ echo ""
4157

4258
echo "Creating release $TAG"
4359
gh release create "$TAG" \
44-
"$ARTIFACT_LINUX_ARCHIVE" \
60+
${ARTIFACTS[@]} \
4561
--title "$TAG" \
4662
--notes ""

.aliases/util.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
2+
confirm_execution() {
3+
PROMPT="$1"
4+
if [[ -z "$PROMPT" ]]; then
5+
PROMPT="confirm"
6+
fi
7+
8+
while true; do
9+
read -p "Are you sure you want to proceed? Type '$PROMPT' to continue: " input
10+
if [[ $input == "$PROMPT" ]]; then
11+
echo "Proceeding..."
12+
break
13+
else
14+
echo "Invalid input. Please type '$PROMPT' to continue."
15+
fi
16+
done
17+
}

flake.nix

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@
5252
flake = (pkgs.hixProject compiler-nix-name).flake {};
5353
flakeStatic = (pkgs.pkgsCross.musl64.hixProject compiler-nix-name).flake {};
5454

55-
packageForGitHub = rnls: pkgs.runCommand "rust-notebook-language-server-${rnls.version}" {} ''
56-
name="rust-notebook-language-server-${rnls.version}-x86_64-linux"
55+
packageForGitHub = rnls: pkgs.runCommand "rust-notebook-language-server-${rnls.version}-${system}" {} ''
56+
name="rust-notebook-language-server-${rnls.version}-${system}"
5757
5858
mkdir -p $out
5959
cp ${rnls}/bin/rust-notebook-language-server $out/$name
@@ -67,9 +67,21 @@
6767
packages = (rec {
6868
inherit (pkgs) cabal2nix stack;
6969

70-
default = flakeStatic.packages."rust-notebook-language-server:exe:rust-notebook-language-server";
70+
default = static;
71+
72+
static = flakeStatic.packages."rust-notebook-language-server:exe:rust-notebook-language-server";
7173
dynamic = flake.packages."rust-notebook-language-server:exe:rust-notebook-language-server";
72-
packaged = packageForGitHub default;
74+
75+
githubArtifacts = packageForGitHub (if pkgs.stdenv.isDarwin then dynamic else static);
76+
77+
grandCombinedGithubArtifacts = pkgs.symlinkJoin {
78+
name = "rust-notebook-language-server-grand-combined-artifacts";
79+
paths = [
80+
self.packages.x86_64-linux.githubArtifacts
81+
self.packages.x86_64-darwin.githubArtifacts
82+
self.packages.aarch64-darwin.githubArtifacts
83+
];
84+
};
7385

7486
# No GMP (we test the dynamic builds to make sure GMP doesn't end up in the static builds)
7587
verify-no-gmp = pkgs.writeShellScriptBin "verify-no-gmp.sh" ''

package.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: rust-notebook-language-server
2-
version: 0.2.2.0
2+
version: 0.2.3.0
33

44
extra-source-files:
55
- README.md

rust-notebook-language-server.cabal

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
cabal-version: 1.12
22

3-
-- This file has been generated from package.yaml by hpack version 0.36.0.
3+
-- This file has been generated from package.yaml by hpack version 0.37.0.
44
--
55
-- see: https://github.com/sol/hpack
66

77
name: rust-notebook-language-server
8-
version: 0.2.2.0
8+
version: 0.2.3.0
99
build-type: Simple
1010
extra-source-files:
1111
README.md

0 commit comments

Comments
 (0)