Skip to content

Commit

Permalink
chore: add doc files and example files in the archive
Browse files Browse the repository at this point in the history
  • Loading branch information
cyunrei committed Mar 3, 2024
1 parent ba8e4b2 commit 8316cba
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,18 @@ test:
go test

.PHONY: archive
define create_archive
cd $(BUILD_DIR) && tar -czvf $1-$2.tar.gz $(PROJECT_NAME)-$2$3 \
-C ../ LICENSE rules_example.json rules_example.yaml README.md
cd $(BUILD_DIR) && sha256sum $1-$2.tar.gz > $1-$2.tar.gz.sha256
endef
archive:
cd $(BUILD_DIR) && tar -czvf $(PROJECT_NAME)-linux-aarch64.tar.gz $(PROJECT_NAME)-linux-aarch64
cd $(BUILD_DIR) && tar -czvf $(PROJECT_NAME)-linux-x86_64.tar.gz $(PROJECT_NAME)-linux-x86_64
cd $(BUILD_DIR) && tar -czvf $(PROJECT_NAME)-windows-aarch64.tar.gz $(PROJECT_NAME)-windows-aarch64.exe
cd $(BUILD_DIR) && tar -czvf $(PROJECT_NAME)-windows-x86_64.tar.gz $(PROJECT_NAME)-windows-x86_64.exe
cd $(BUILD_DIR) && tar -czvf $(PROJECT_NAME)-darwin-aarch64.tar.gz $(PROJECT_NAME)-darwin-aarch64
cd $(BUILD_DIR) && tar -czvf $(PROJECT_NAME)-darwin-x86_64.tar.gz $(PROJECT_NAME)-darwin-x86_64

cd $(BUILD_DIR) && sha256sum $(PROJECT_NAME)-linux-aarch64.tar.gz > $(PROJECT_NAME)-linux-aarch64.tar.gz.sha256
cd $(BUILD_DIR) && sha256sum $(PROJECT_NAME)-linux-x86_64.tar.gz > $(PROJECT_NAME)-linux-x86_64.tar.gz.sha256
cd $(BUILD_DIR) && sha256sum $(PROJECT_NAME)-windows-aarch64.tar.gz > $(PROJECT_NAME)-windows-aarch64.tar.gz.sha256
cd $(BUILD_DIR) && sha256sum $(PROJECT_NAME)-windows-x86_64.tar.gz > $(PROJECT_NAME)-windows-x86_64.tar.gz.sha256
cd $(BUILD_DIR) && sha256sum $(PROJECT_NAME)-darwin-aarch64.tar.gz > $(PROJECT_NAME)-darwin-aarch64.tar.gz.sha256
cd $(BUILD_DIR) && sha256sum $(PROJECT_NAME)-darwin-x86_64.tar.gz > $(PROJECT_NAME)-darwin-x86_64.tar.gz.sha256
$(call create_archive,$(PROJECT_NAME),linux-aarch64)
$(call create_archive,$(PROJECT_NAME),linux-x86_64)
$(call create_archive,$(PROJECT_NAME),windows-aarch64,.exe)
$(call create_archive,$(PROJECT_NAME),windows-x86_64,.exe)
$(call create_archive,$(PROJECT_NAME),darwin-aarch64)
$(call create_archive,$(PROJECT_NAME),darwin-x86_64)

.PHONY: release
release: test build-all archive
release: clean test build-all archive

0 comments on commit 8316cba

Please sign in to comment.