Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@ versions); `pr.sh release` takes `TAG_PREFIX` and `WRITE_VERSION` (the
project's version recipe) from the environment, and `pr.sh merge` a
comma-separated list of every version file. One release per pull request.

Bare-version tags (`1.0.10`, the widgets): an empty `TAG_PREFIX` for
`pr.sh release` and `tag-prefix: ""` for `release-intent` and `release-tag`.

Onboarding a repository onto this flow, besides the caller files:

- `main` ruleset: squash merges only; repository setting "default commit
Expand Down
9 changes: 5 additions & 4 deletions scripts/pr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@
# required checks pass; its merge starts <workflow> (the image and the
# tag), and this waits for that run.
#
# Env: PR_WAIT_SECONDS (default 20) between polls. For one of several release
# projects in a repository: TAG_PREFIX (default v; e.g. db-v) and
# WRITE_VERSION (default _write-version; the project's recipe).
# Env: PR_WAIT_SECONDS (default 20) between polls. TAG_PREFIX (default v when
# unset; e.g. db-v for one of several release projects in a repository, empty
# for bare-version tags) and WRITE_VERSION (default _write-version; the
# project's recipe).
set -euo pipefail

wait_s=${PR_WAIT_SECONDS:-20}
Expand Down Expand Up @@ -170,7 +171,7 @@ cmd_release() {
base=$(version "$vf" origin/main)
[ -n "$base" ] || die "release: $vf has no version on origin/main"
next=$(next_version "$level" "$base")
tag="${TAG_PREFIX:-v}$next"
tag="${TAG_PREFIX-v}$next"
title="release $name $tag"
if [ "$(version "$vf")" != "$next" ]; then
just "${WRITE_VERSION:-_write-version}" "$next"
Expand Down
8 changes: 8 additions & 0 deletions scripts/test_pr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,14 @@ unset TAG_PREFIX
expect "release: title with the prefixed tag" logged "gh pr create --base main --head feat --title release platform-db db-v1.2.4"
expect "release: the prefixed tag fetched" git -C "$repo" rev-parse --verify refs/tags/db-v1.2.4

setup package.json 1.0.9
ci_tag 1.0.10
export TAG_PREFIX=
check "release: an empty TAG_PREFIX tags the bare version" 0 release patch widget-label package.json build-publish.yml package.json
unset TAG_PREFIX
expect "release: title with the bare version" logged "gh pr create --base main --head feat --title release widget-label 1.0.10"
expect "release: the bare tag fetched" git -C "$repo" rev-parse --verify refs/tags/1.0.10

setup VERSION 1.2.3
ci_tag v1.2.4
export WRITE_VERSION=_write-db-version
Expand Down
Loading