File tree Expand file tree Collapse file tree 3 files changed +43
-2
lines changed Expand file tree Collapse file tree 3 files changed +43
-2
lines changed Original file line number Diff line number Diff line change 7
7
push :
8
8
# Enable when testing release infrastructure on a branch.
9
9
# branches:
10
- # - fix-releases
10
+ # - fix-releases
11
11
tags :
12
- - ' v*'
12
+ # For now, real releases always use `workflow_dispatch`, and running the workflow on tag pushes
13
+ # is only done in testing. This is because we usually push too many tags at once for the `push`
14
+ # event to be triggered, since there are usually more than 3 crates tagged together. So the
15
+ # `push` trigger doesn't usually work. If we allow it, we risk running the workflow twice if
16
+ # it is also manually triggered based on the assumption that it would not run. See #1970 for
17
+ # details. See also the `run-release-workflow` and `roll-release` recipes in the `justfile`.
18
+ # - 'v*'
19
+ - ' v*-DO-NOT-USE' # Pattern for tags used to test the workflow (usually done in a fork).
13
20
workflow_dispatch :
14
21
15
22
permissions :
Original file line number Diff line number Diff line change
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]} "
Original file line number Diff line number Diff line change @@ -295,3 +295,20 @@ check-mode:
295
295
# Delete `gix-packetline-blocking/src` and regenerate from `gix-packetline/src`
296
296
copy-packetline:
297
297
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
You can’t perform that action at this time.
0 commit comments