Commit 8d294cfe authored by Mickaël Desfrênes's avatar Mickaël Desfrênes
Browse files

add checksum artifacts

parent edd6d7c6
Loading
Loading
Loading
Loading
+23 −3
Original line number Diff line number Diff line
@@ -21,8 +21,17 @@ RELEASE_ARTIFACTS := \
	server_install_scripts/linux_amd64_install.sh \
	server_install_scripts/macos_arm64_install.sh \
	server_install_scripts/env
CHECKSUM_ARTIFACTS := \
	$(DIST_DIR)/$(APP_NAME)-linux-amd64 \
	$(DIST_DIR)/$(APP_NAME)-darwin-arm64 \
	$(WINDOWS_EXE) \
	$(MACOS_INSTALLER) \
	$(WINDOWS_INSTALLER) \
	$(DEB_PACKAGE)
RELEASE_CHECKSUMS := $(addsuffix .checksum.txt,$(CHECKSUM_ARTIFACTS))
RELEASE_UPLOAD_FILES := $(RELEASE_ARTIFACTS) $(RELEASE_CHECKSUMS)

.PHONY: build test installer-macos installer-windows installer-deb release-upload clean help
.PHONY: build test installer-macos installer-windows installer-deb release-checksums release-upload clean help

build: ## Build cross-platform binaries into dist (linux/amd64, darwin/arm64, windows/amd64)
	mkdir -p $(DIST_DIR)
@@ -70,8 +79,19 @@ installer-deb: ## Build a Debian package (.deb) for linux/amd64 (requires dpkg-d
		dpkg-deb --build "$$TMP_DIR" "$(DEB_PACKAGE)"; \
		echo "Created $(DEB_PACKAGE)"

release-upload: build installer-macos installer-windows installer-deb ## Build all binaries/installers and upload them via scp
	scp $(RELEASE_ARTIFACTS) $(SCP_DEST)
release-checksums: ## Compute SHA-256 checksum files for release artifacts
	@for artifact in $(CHECKSUM_ARTIFACTS); do \
		if [ ! -f "$$artifact" ]; then \
			echo "Missing release artifact: $$artifact"; \
			exit 1; \
		fi; \
		checksum_file="$$artifact.checksum.txt"; \
		shasum -a 256 "$$artifact" | awk -v name="$$(basename "$$artifact")" '{print $$1 "  " name}' > "$$checksum_file"; \
		echo "Created $$checksum_file"; \
	done

release-upload: build installer-macos installer-windows installer-deb release-checksums ## Build all binaries/installers and upload them via scp
	scp $(RELEASE_UPLOAD_FILES) $(SCP_DEST)

clean: ## Remove build artifacts
	rm -rf $(DIST_DIR)