Skip to content

Commit 179db39

Browse files
committed
build: fix the version override propagation
1 parent ca192ba commit 179db39

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

Taskfile.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ vars:
77
release_tag_message_prefix: aifr version
88
version_embedded_file: internal/version/version.go
99

10+
env:
11+
# Allow a version override to come before the command as an env override,
12+
# OR to come after the command as a var-assignment.
13+
#
14+
# We do this at the top-level because `release:commits-and-tag` uses a
15+
# sub-process to invoke us, to get the version into a shell variable, and we
16+
# need the CLI assignment to propagate into the environment.
17+
# Note though that we do need to explicitly unset this for the _second_ invocation.
18+
VERSION_OVERRIDE: "{{.VERSION_OVERRIDE}}"
19+
1020
tasks:
1121
default:
1222
deps: [help]
@@ -128,9 +138,6 @@ tasks:
128138
env:
129139
task_exe: "{{.TASK_EXE}}"
130140
task_name: "{{.TASK}}"
131-
# allow the version to come before the command as an env override,
132-
# OR to come after the command as a var-assignment
133-
VERSION_OVERRIDE: "{{.VERSION_OVERRIDE}}"
134141
cmd: |-2
135142
shopt -s extglob
136143
if [[ -n "${VERSION_OVERRIDE:-}" ]]; then
@@ -187,7 +194,9 @@ tasks:
187194
- 'git commit -o "$version_file" -m "chore: bump hard-coded version to ${release_version}"'
188195
- 'git tag -s -m "${message_prefix} ${release_version#v}" -e "$release_version"'
189196
- task: next-version:write
190-
- 'git commit -o "$version_file" -m "chore: bump hard-coded version to $(task next-version:show)"'
197+
vars:
198+
VERSION_OVERRIDE: ""
199+
- 'git commit -o "$version_file" -m "chore: bump hard-coded version to $(env VERSION_OVERRIDE="" task next-version:show)"'
191200

192201
_have_cargo_tool:*: # shim for when the binary name == crate name
193202
internal: true

0 commit comments

Comments
 (0)