Skip to content

Commit 4f03e37

Browse files
committed
fixup! chore: update release workflow to use new build scripts
1 parent d1edee5 commit 4f03e37

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

.github/workflows/release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ on:
2424
# In a non-snapshot we want the ./scripts/version.sh script to never generate a
2525
# +dev version.
2626
env:
27-
CODER_NO_DEV_VERSION: ${{ github.event.inputs.snapshot && '' || 'true' }}
27+
CODER_NO_DEV_VERSION: ${{ github.event.inputs.snapshot && 'false' || 'true' }}
2828

2929
jobs:
3030
linux-windows:

scripts/lib.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,10 @@ cdroot() {
5757
# be sourced by other scripts.
5858
execrelative() {
5959
pushd "$SCRIPT_DIR" || error "Could not change directory to '$SCRIPT_DIR'"
60-
"$@"
60+
rc=0
61+
"$@" || rc=$?
6162
popd
63+
return $rc
6264
}
6365

6466
# maybedryrun prints the given program and flags, and then, if the first

scripts/version.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,14 @@ version="$last_tag"
2020
# Dev versions are denoted by the "+dev." suffix with a trailing commit short
2121
# SHA.
2222
if [[ "$last_tag" != "$current" ]]; then
23-
if [[ "${CODER_NO_DEV_VERSION:-}" != "" ]]; then
23+
if [[ "${CODER_NO_DEV_VERSION:-}" == *t* ]]; then
24+
# make won't exit on $(shell cmd) failures :(
25+
if [[ "$(ps -o comm= "$PPID" || true)" == *make* ]]; then
26+
log "ERROR: version.sh attemped to generate a dev version string when CODER_NO_DEV_VERSION was set"
27+
kill "$PPID"
28+
exit 1
29+
fi
30+
2431
error "version.sh attemped to generate a dev version string when CODER_NO_DEV_VERSION was set"
2532
fi
2633
version+="+dev.$(git rev-parse --short HEAD)"

0 commit comments

Comments
 (0)