|
5 | 5 | # - build-fat: builds all "fat" binaries for all architectures
|
6 | 6 | # - build-slim: builds all "slim" binaries (no frontend or slim binaries
|
7 | 7 | # embedded) for all architectures
|
| 8 | +# - release: simulate a release (mostly, does not push images) |
8 | 9 | # - build/coder(-slim)?_${os}_${arch}(.exe)?: build a single fat binary
|
9 | 10 | # - build/coder_${os}_${arch}.(zip|tar.gz): build a release archive
|
10 | 11 | # - build/coder_linux_${arch}.(apk|deb|rpm): build a release Linux package
|
@@ -45,7 +46,7 @@ OS_ARCHES := \
|
45 | 46 | # Archive formats and their corresponding ${OS}_${ARCH} combos.
|
46 | 47 | ARCHIVE_TAR_GZ := linux_amd64 linux_arm64 linux_armv7
|
47 | 48 | ARCHIVE_ZIP := \
|
48 |
| - darwin darwin_arm64 \ |
| 49 | + darwin_amd64 darwin_arm64 \ |
49 | 50 | windows_amd64 windows_arm64
|
50 | 51 |
|
51 | 52 | # All package formats we build and the ${OS}_${ARCH} combos we build them for.
|
@@ -87,6 +88,9 @@ build-slim bin: $(CODER_SLIM_BINARIES)
|
87 | 88 | build-fat build-full build: $(CODER_FAT_BINARIES)
|
88 | 89 | .PHONY: build-fat build-full build
|
89 | 90 |
|
| 91 | +release: $(CODER_FAT_BINARIES) $(CODER_ALL_ARCHIVES) $(CODER_ALL_PACKAGES) $(CODER_ALL_ARCH_IMAGES) build/coder_helm_$(VERSION).tgz |
| 92 | +.PHONY: release |
| 93 | + |
90 | 94 | build/coder-slim_$(VERSION)_checksums.sha1: $(CODER_SLIM_BINARIES)
|
91 | 95 | pushd ./build
|
92 | 96 | openssl dgst -r -sha1 coder-slim_"$(VERSION)"_* | tee "$(@F)"
|
@@ -216,14 +220,18 @@ $(CODER_ALL_ARCHIVES): $(CODER_FAT_BINARIES)
|
216 | 220 |
|
217 | 221 | # This task builds all packages. It parses the target name to get the metadata
|
218 | 222 | # for the build, so it must be specified in this format:
|
219 |
| -# build/coder_${version}_${os}_${arch}.${format} |
| 223 | +# build/coder_${version}_linux_${arch}.${format} |
220 | 224 | #
|
221 | 225 | # Supports apk, deb, rpm for all linux targets.
|
222 | 226 | #
|
223 |
| -# This depends on all fat binaries because it's difficult to do dynamic |
224 |
| -# dependencies due to the extensions in the filenames. These targets are |
225 |
| -# typically only used during release anyways. |
226 |
| -$(CODER_ALL_PACKAGES): $(CODER_FAT_BINARIES) |
| 227 | +# This depends on all Linux fat binaries and archives because it's difficult to |
| 228 | +# do dynamic dependencies due to the extensions in the filenames. These targets |
| 229 | +# are typically only used during release anyways. |
| 230 | +# |
| 231 | +# Packages need to run after the archives are built, otherwise they cause tar |
| 232 | +# errors like "file changed as we read it". |
| 233 | +CODER_PACKAGE_DEPS := $(foreach os_arch, $(PACKAGE_OS_ARCHES), build/coder_$(VERSION)_$(os_arch) build/coder_$(VERSION)_$(os_arch).tar.gz) |
| 234 | +$(CODER_ALL_PACKAGES): $(CODER_PACKAGE_DEPS) |
227 | 235 | $(get-mode-os-arch-ext)
|
228 | 236 |
|
229 | 237 | ./scripts/package.sh \
|
@@ -252,7 +260,16 @@ $(CODER_ALL_NOVERSION_IMAGES_PUSHED): push/build/coder_%: push/build/coder_$(VER
|
252 | 260 | # build/coder_${version}_${os}_${arch}.tag
|
253 | 261 | #
|
254 | 262 | # Supports linux_amd64, linux_arm64, linux_armv7.
|
255 |
| -$(CODER_ALL_ARCH_IMAGES): build/coder_$(VERSION)_%.tag: build/coder_$(VERSION)_% |
| 263 | +# |
| 264 | +# Images need to run after the archives and packages are built, otherwise they |
| 265 | +# cause errors like "file changed as we read it". |
| 266 | +$(CODER_ALL_ARCH_IMAGES): build/coder_$(VERSION)_%.tag: \ |
| 267 | + build/coder_$(VERSION)_% \ |
| 268 | + build/coder_$(VERSION)_%.apk \ |
| 269 | + build/coder_$(VERSION)_%.deb \ |
| 270 | + build/coder_$(VERSION)_%.rpm \ |
| 271 | + build/coder_$(VERSION)_%.tar.gz |
| 272 | + |
256 | 273 | $(get-mode-os-arch-ext)
|
257 | 274 |
|
258 | 275 | image_tag="$$(./scripts/image_tag.sh --arch "$$arch" --version "$(VERSION)")"
|
|
0 commit comments