Skip to content

Commit 7f1b557

Browse files
committed
Adapt publish script for v1
1 parent d93124a commit 7f1b557

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

‎scripts/publish-release.sh‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ if ! git diff-index --quiet HEAD --; then
88
exit 1
99
fi
1010

11-
if [ "$(git rev-parse --abbrev-ref HEAD)" != main ]; then
11+
if [ "$(git rev-parse --abbrev-ref HEAD)" != v1/main ]; then
1212
echo "error: requires main branch" >&2
1313
exit 1
1414
fi
1515

1616
# ensure we have the latest version tags
1717
git fetch origin -pft
1818

19-
versions="$(git tag | grep '^v[0-9]\+\.[0-9]\+\.[0-9]\+')"
19+
versions="$(git tag | grep '^v1\.[0-9]\+\.[0-9]\+')"
2020
v_latest="$(npx -- semver --include-prerelease $versions | tail -n1)"
2121

2222
_is_prerelease() {
@@ -45,7 +45,7 @@ fi
4545

4646
gum confirm "prepare draft release for $v_new?" || exit 1
4747

48-
git push origin main
48+
git push origin v1/main
4949

5050
is_prerelease=$(_is_prerelease $v_new)
5151

@@ -55,14 +55,15 @@ gh release create \
5555
--prerelease=$is_prerelease \
5656
--generate-notes \
5757
--notes-start-tag=v$v_latest \
58+
--latest=false \
5859
--title=v$v_new
5960

60-
gh workflow run cd.yml --raw-field version="$v_new"
61+
gh workflow run cd.yml --ref=v1/main --raw-field version="$v_new"
6162
# ^^ infuriatingly does not tell us the ID of the run
6263

6364
gum spin --title 'sleeping 5s because GitHub API is slow' -- sleep 5
6465

65-
run_id=$(gh run list --json databaseId --workflow=cd.yml | jq '.[0].databaseId')
66+
run_id=$(gh run list --json databaseId --branch=v1/main --workflow=cd.yml | jq '.[0].databaseId')
6667

6768
if ! gh run watch --exit-status $run_id; then
6869
foo=$?

0 commit comments

Comments
 (0)