Skip to content

Commit ec6b243

Browse files
authored
REC-102: release: multiple fixes (#56)
Set uploaded artifact names uniquely so that different jobs upload separate artifacts. The default was to overwrite the same artifact. No such setting is needed for downloading: the default is to download all artifacts. Fixed the regular expression used to validate semantic versions. We used a PCRE-compatible regex from semver.org, but grep doesn't use PCRE, and different versions of grep (on Linux and macOS at least) interpret the same expression differently. Hopefully we've landed on something that works. Added an .exe extension to the Windows artifact.
1 parent 0f4e476 commit ec6b243

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ jobs:
9090
- uses: actions/upload-artifact@v4
9191
if: success()
9292
with:
93+
name: linux
9394
path: _out
9495
if-no-files-found: error
9596
retention-days: 1
@@ -143,6 +144,7 @@ jobs:
143144
- uses: actions/upload-artifact@v4
144145
if: success()
145146
with:
147+
name: ${{ matrix.os }}
146148
path: _out
147149
if-no-files-found: error
148150
retention-days: 1

infra/release-build.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ sign_and_notarize_binary () {
7171
return
7272
}
7373

74+
EXT=
7475
case "${OS}" in
7576
macos)
7677
TARGETS=(
@@ -88,6 +89,7 @@ windows)
8889
TARGETS=(
8990
//cmd/engflow_auth:engflow_auth_windows_x64
9091
)
92+
EXT=.exe
9193
;;
9294
esac
9395

@@ -104,5 +106,5 @@ trap uninstall_cert EXIT
104106
for target in "${TARGETS[@]}"; do
105107
target_file=$(bazel cquery --output=files "${target}")
106108
sign_and_notarize_binary "${target_file}"
107-
cp "${target_file}" _out/
109+
cp "${target_file}" "_out/$(basename ${target_file})${EXT}"
108110
done

infra/release-check.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@ if [[ -z "${RELEASE_VERSION:-}" ]]; then
2222
exit 1
2323
fi
2424

25-
# Taken from https://semver.org/, with a `v` prepended
26-
readonly SEMVER_REGEX='^v(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(-((0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(\+([0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*))?$'
25+
# Taken from https://semver.org/,
26+
# prepended 'v', required by Go;
27+
# replaced \d with [0-9] for compatibility with grep regex flavor.
28+
readonly SEMVER_REGEX='^v(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-((0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*))*))?(\+([0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*))?$'
2729

2830
# Supplied version string must follow semver
2931
if ! grep --quiet --extended-regexp "${SEMVER_REGEX}" <<<${RELEASE_VERSION}; then

0 commit comments

Comments
 (0)