Skip to content

Commit d1acaf4

Browse files
committed
Add just recipes that trigger release.yml
1 parent 5603ae7 commit d1acaf4

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

etc/unique-v-tag.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env bash
2+
3+
set -efu
4+
IFS=$'\n'
5+
6+
# shellcheck disable=SC2207 # Intentionally splitting. No globbing due to set -f.
7+
tags=(
8+
$(git tag --points-at HEAD -- 'v*')
9+
)
10+
11+
count="${#tags[@]}"
12+
if ((count != 1)); then
13+
printf '%s: error: Found %d matching v* tags, need exactly 1.\n' "$0" "$count" >&2
14+
exit 1
15+
fi
16+
17+
printf '%s\n' "${tags[0]}"

justfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,3 +295,20 @@ check-mode:
295295
# Delete `gix-packetline-blocking/src` and regenerate from `gix-packetline/src`
296296
copy-packetline:
297297
etc/copy-packetline.sh
298+
299+
# Get the unique `v*` tag at `HEAD`, or fail with an error
300+
unique-v-tag:
301+
etc/unique-v-tag.sh
302+
303+
# Trigger the `release.yml` workflow on the current `v*` tag
304+
run-release-workflow repo='':
305+
optional_repo_arg={{ quote(repo) }} && \
306+
export GH_REPO="${optional_repo_arg:-"${GH_REPO:-GitoxideLabs/gitoxide}"}" && \
307+
tag_name="$({{ j }} unique-v-tag)" && \
308+
printf 'Running release.yml in %s repo for %s tag.\n' "$GH_REPO" "$tag_name" && \
309+
gh workflow run release.yml --ref "refs/tags/$tag_name"
310+
311+
# Run `cargo smart-release` and then trigger `release.yml` for the `v*` tag
312+
roll-release *csr-args:
313+
cargo smart-release {{ csr-args }}
314+
{{ j }} run-release-workflow

0 commit comments

Comments
 (0)