-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cli: Streamline release workflow for v0.2.2 (#104)
- Loading branch information
1 parent
f7b38f0
commit 9076146
Showing
4 changed files
with
84 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# ChangeLog | ||
|
||
## v0.2.2 | ||
|
||
### Additions | ||
|
||
- The new `scip print` subcommand can be used to view a SCIP index without access to protoc. (https://github.com/sourcegraph/scip/pull/91) | ||
- The new `scip lint` subcommand can be used to identify correctness and redundancy issues with a SCIP index. (https://github.com/sourcegraph/scip/pull/92) | ||
|
||
### Fixes | ||
|
||
- `scip --version` now works as expected instead of reporting 0.1.0. (https://github.com/sourcegraph/scip/pull/97) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.2.1 | ||
0.2.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
{ | ||
if [ -z "${NEW_VERSION:-}" ]; then | ||
echo "error: Missing value for environment variable NEW_VERSION" | ||
echo "hint: Invoke this script as NEW_VERSION=M.N.P ./tools/scripts/publish-scip-ruby.sh" | ||
exit 1 | ||
fi | ||
|
||
if ! grep -q "## v$NEW_VERSION" CHANGELOG.md; then | ||
echo "error: Missing CHANGELOG entry for v$NEW_VERSION" | ||
echo "note: CHANGELOG entries are required for publishing releases" | ||
exit 1 | ||
fi | ||
|
||
if ! grep -q "$NEW_VERSION" cmd/version.txt; then | ||
echo "error: SCIP version in cmd/version.txt doesn't match NEW_VERSION=$NEW_VERSION" | ||
exit 1 | ||
fi | ||
|
||
if ! git diff --quiet; then | ||
echo "error: Found unstaged changes; aborting." | ||
exit 1 | ||
fi | ||
|
||
if ! git diff --quiet --cached; then | ||
echo "error: Found staged-but-uncommitted changes; aborting." | ||
exit 1 | ||
fi | ||
|
||
if ! git remote -v | grep "origin" | grep -q "https://github.com/sourcegraph/scip.git"; then | ||
echo "error: remote 'origin' doesn't point to sourcegraph/scip" | ||
exit 1 | ||
fi | ||
|
||
if ! git rev-parse --abbrev-ref HEAD | grep -q "main"; then | ||
echo "error: Releases should be published from main but HEAD is on a different branch" >&2 | ||
exit 1 | ||
fi | ||
} >&2 | ||
|
||
TAG="v$NEW_VERSION" | ||
git tag "$TAG" | ||
git push origin "$TAG" | ||
|
||
{ | ||
echo "See the [CHANGELOG](https://github.com/sourcegraph/scip/blob/main/CHANGELOG.md) to see what's new in scip v$NEW_VERSION." | ||
echo '' | ||
echo 'Download the CLI for your current platform using:' | ||
echo '' | ||
echo '```bash' | ||
echo 'env \' | ||
echo " TAG=\"v$NEW_VERSION\" \\" | ||
echo ' OS="$(uname -s | tr '\''[:upper:]'\'' '\''[:lower:]'\'')" \' | ||
echo ' ARCH="$(uname -m | sed -e '\''s/x86_64/amd64/'\'')" \' | ||
echo ' bash -c '\''curl -L "https://github.com/sourcegraph/scip/releases/download/$TAG/scip-$OS-$ARCH.tar.gz"'\'' \' | ||
echo '| tar xzf - scip' | ||
echo '```' | ||
} | gh release create --title "scip-ruby v$NEW_VERSION" --notes-file - |