publish-release.sh raw
1 #!/bin/sh
2 # Build, sign and publish a gateway release as GitHub release assets.
3 #
4 # The manifest is an asset too, so the gateway can be pointed at the stable
5 # latest/download URL and never needs to know a version in advance.
6 #
7 # NOSTRINO_RELEASE_KEY=~/.config/nostrino/release.key \
8 # ./scripts/publish-release.sh 0.3.4 mlekudev/nostrino-releases
9 #
10 set -eu
11
12 VERSION=${1:?usage: publish-release.sh <version> <github-owner/repo>}
13 REPO=${2:?usage: publish-release.sh <version> <github-owner/repo>}
14 KEY=${NOSTRINO_RELEASE_KEY:?set NOSTRINO_RELEASE_KEY to the Ed25519 private key file}
15 OUT=${OUT:-dist}
16 BASE="https://github.com/$REPO/releases/download/v$VERSION"
17
18 OUT="$OUT" NOSTRINO_RELEASE_KEY="$KEY" ./scripts/build-release.sh "$VERSION" "$BASE"
19
20 gh release create "v$VERSION" "$OUT"/* \
21 --repo "$REPO" \
22 --title "nostrino $VERSION" \
23 --notes "${NOTES:-Gateway release $VERSION.}"
24