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
613for arg do
714 shift
815
9- [ "$arg" = "--dry-run " ] && DRY_RUN=t && continue
16+ [ "$arg" = "--grand " ] && GRAND="t" && continue
1017done
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
1929VERSION="$(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"
3450echo "Tagging at $TAG"
3551git tag "$TAG" -f
3652echo ""
@@ -41,6 +57,6 @@ echo ""
4157
4258echo "Creating release $TAG"
4359gh release create "$TAG" \
44- "$ARTIFACT_LINUX_ARCHIVE" \
60+ ${ARTIFACTS[@]} \
4561 --title "$TAG" \
4662 --notes ""
0 commit comments