File tree 3 files changed +18
-6
lines changed 3 files changed +18
-6
lines changed Original file line number Diff line number Diff line change 78
78
run : |
79
79
set -euxo pipefail
80
80
81
- # build and push Docker images for each architecture
81
+ # build and (maybe) push Docker images for each architecture
82
82
images=()
83
83
for arch in amd64 armv7 arm64; do
84
84
img="$(
@@ -90,18 +90,25 @@ jobs:
90
90
images+=("$img")
91
91
done
92
92
93
+ # we can't build multi-arch if the images aren't pushed, so quit now
94
+ # if dry-running
95
+ if [[ "$CODER_RELEASE" != *t* ]]; then
96
+ echo Skipping multi-arch docker builds due to dry-run.
97
+ exit 0
98
+ fi
99
+
93
100
# build and push multi-arch manifest
94
101
./scripts/build_docker_multiarch.sh \
95
- ${{ (!github.event.inputs.dry_run && !github.event.inputs.snapshot) && ' --push' || '' }} \
102
+ --push \
96
103
"${images[@]}"
97
104
98
105
# if the current version is equal to the highest (according to semver)
99
106
# version in the repo, also create a multi-arch image as ":latest" and
100
107
# push it
101
108
if [[ "$(git tag | grep '^v' | grep -vE '(rc|dev|-|\+|\/)' | sort -r --version-sort | head -n1)" == "v$(./scripts/version.sh)" ]]; then
102
109
./scripts/build_docker_multiarch.sh \
110
+ --push \
103
111
--target "$(./scripts/image_tag.sh --version latest)" \
104
- ${{ (!github.event.inputs.dry_run && !github.event.inputs.snapshot) && '--push' || '' }} \
105
112
"${images[@]}"
106
113
fi
107
114
Original file line number Diff line number Diff line change @@ -71,6 +71,10 @@ if [[ "${#files[@]}" == 0 ]]; then
71
71
error " No files supplied"
72
72
fi
73
73
74
+ if [[ " $dry_run " == 0 ]] && [[ " $version " == * dev* ]]; then
75
+ error " Cannot publish a dev version to GitHub"
76
+ fi
77
+
74
78
# The git commands need to be executed from within the repository.
75
79
cdroot
76
80
Original file line number Diff line number Diff line change @@ -15,16 +15,17 @@ set -euo pipefail
15
15
source " $( dirname " ${BASH_SOURCE[0]} " ) /lib.sh"
16
16
cdroot
17
17
18
- version=" $( git describe --tags --abbrev=0) "
18
+ last_tag=" $( git describe --tags --abbrev=0) "
19
+ version=" $last_tag "
19
20
20
21
# If the HEAD has extra commits since the last tag then we are in a dev version.
21
22
#
22
23
# Dev versions are denoted by the "-devel+" suffix with a trailing commit short
23
24
# SHA.
24
25
if [[ " ${CODER_RELEASE:- } " == * t* ]]; then
25
- # $version will equal `git describe --always` if we currently have the tag
26
+ # $last_tag will equal `git describe --always` if we currently have the tag
26
27
# checked out.
27
- if [[ " $version " != " $( git describe --always) " ]]; then
28
+ if [[ " $last_tag " != " $( git describe --always) " ]]; then
28
29
# make won't exit on $(shell cmd) failures, so we have to kill it :(
29
30
if [[ " $( ps -o comm= " $PPID " || true) " == * make* ]]; then
30
31
log " ERROR: version.sh attemped to generate a dev version string when CODER_RELEASE was set"
You can’t perform that action at this time.
0 commit comments