diff options
author | oxpa <iippolitov@gmail.com> | 2024-09-17 14:21:10 +0100 |
---|---|---|
committer | oxpa <iippolitov@gmail.com> | 2024-09-17 14:21:10 +0100 |
commit | 2417826d8bebf921ee1be102ef8ce702f0683d66 (patch) | |
tree | 76d29a1705415ed7368870826dbb2f04942ee794 /tools/unitctl/build/release.mk | |
parent | 0e79d961bb1ea68674961da1703ffedb1ddf6e43 (diff) | |
parent | 24ed91f40634372d99f67f0e4e3c2ac0abde81bd (diff) | |
download | unit-2417826d8bebf921ee1be102ef8ce702f0683d66.tar.gz unit-2417826d8bebf921ee1be102ef8ce702f0683d66.tar.bz2 |
Merge tag '1.33.0' into packaging.
Unit 1.33.0 release.
Diffstat (limited to '')
-rw-r--r-- | tools/unitctl/build/release.mk | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/tools/unitctl/build/release.mk b/tools/unitctl/build/release.mk new file mode 100644 index 00000000..949e9301 --- /dev/null +++ b/tools/unitctl/build/release.mk @@ -0,0 +1,57 @@ +.ONESHELL: target/dist/release_notes.md +target/dist/release_notes.md: target/dist target/dist/SHA256SUMS + $(info $(M) building release notes) @ + $Q echo "# Release Notes" > target/dist/release_notes.md + echo '## SHA256 Checksums' >> target/dist/release_notes.md + echo '```' >> target/dist/release_notes.md + cat target/dist/SHA256SUMS >> target/dist/release_notes.md + echo '```' >> target/dist/release_notes.md + +.PHONY: release-notes +release-notes: target/dist/release_notes.md ## Build release notes + +.PHONY: version +version: ## Outputs the current version + $Q echo "Version: $(VERSION)" + +.PHONY: version-update +.ONESHELL: version-update +version-update: ## Prompts for a new version + $(info $(M) updating repository to new version) @ + $Q echo " last committed version: $(LAST_VERSION)" + $Q echo " Cargo.toml file version : $(VERSION)" + read -p " Enter new version in the format (MAJOR.MINOR.PATCH): " version + $Q echo "$$version" | $(GREP) -qE '^[0-9]+\.[0-9]+\.[0-9]+-?.*$$' || \ + (echo "invalid version identifier: $$version" && exit 1) && \ + $(SED) -i "s/^version\s*=.*$$/version = \"$$version\"/" \ + $(CURDIR)/unit-client-rs/Cargo.toml + $(SED) -i "s/^version\s*=.*$$/version = \"$$version\"/" \ + $(CURDIR)/unitctl/Cargo.toml + $(SED) -i "s/^version\s*=.*$$/version = \"$$version\"/" \ + $(CURDIR)/unit-openapi/Cargo.toml + $(SED) -i "s/^\s*\"packageVersion\":\s*.*$$/ \"packageVersion\": \"$$version\",/" \ + $(CURDIR)/openapi-config.json + @ VERSION=$(shell $(GREP) -Po '^version\s+=\s+"\K.*?(?=")' \ + $(CURDIR)/unitctl/Cargo.toml) + +.PHONY: version-release +.ONESHELL: version-release +version-release: ## Change from a pre-release to full release version + $Q echo "$(VERSION)" | $(GREP) -qE '^[0-9]+\.[0-9]+\.[0-9]+-beta$$' || \ + (echo "invalid version identifier - must contain suffix -beta: $(VERSION)" && exit 1) + export NEW_VERSION="$(shell echo $(VERSION) | $(SED) -e 's/-beta$$//')" + $(SED) -i "s/^version\s*=.*$$/version = \"$$NEW_VERSION\"/" \ + $(CURDIR)/unit-client-rs/Cargo.toml + $(SED) -i "s/^version\s*=.*$$/version = \"$$NEW_VERSION\"/" \ + $(CURDIR)/unitctl/Cargo.toml + $(SED) -i "s/^version\s*=.*$$/version = \"$$NEW_VERSION\"/" \ + $(CURDIR)/unit-openapi/Cargo.toml + $(SED) -i "s/^\s*\"packageVersion\":\s*.*$$/ \"packageVersion\": \"$$NEW_VERSION\",/" \ + $(CURDIR)/openapi-config.json + @ VERSION=$(shell $(GREP) -Po '^version\s+=\s+"\K.*?(?=")' \ + $(CURDIR)/unitctl/Cargo.toml) + +.PHONY: cargo-release +cargo-release: ## Releases a new version to crates.io + $(info $(M) releasing version $(VERSION) to crates.io) @ + $Q $(CARGO) publish |