From 094ca8fe1052c7eb85442411c953d2d198c62330 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christina=20S=C3=B8rensen?= Date: Wed, 4 Oct 2023 13:29:27 +0200 Subject: [PATCH] build(release): improve release automation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christina Sørensen --- Justfile | 25 ++++++++++++++++++------- cliff.toml | 3 +-- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/Justfile b/Justfile index 4cd1ca82..2d58696c 100644 --- a/Justfile +++ b/Justfile @@ -95,20 +95,31 @@ all-release: build-release test-release # release # #---------------# +new_version := "$(convco version --bump)" + # If you're not cafkafk and she isn't dead, don't run this! # # usage: release major, release minor, release patch -@release version: - cargo bump '{{version}}' - git cliff -t $(grep '^version' Cargo.toml | head -n 1 | grep -E '([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+)?' -o) > CHANGELOG.md +@release: + cargo bump "{{new_version}}" + git cliff -t "$(convco version)" > CHANGELOG.md cargo check nix build -L ./#clippy - git checkout -b cafk-release-$(grep '^version' Cargo.toml | head -n 1 | grep -E '([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+)?' -o) - git commit -asm "chore: release $(grep '^version' Cargo.toml | head -n 1 | grep -E '([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+)?' -o)" + git checkout -b "cafk-release-v$(convco version)" + git commit -asm "chore: release eza v$(convco version)" git push echo "waiting 10 seconds for github to catch up..." sleep 10 - gh pr create --draft --title "chore: release $(grep '^version' Cargo.toml | head -n 1 | grep -E '([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+)?' -o)" --body "This PR was auto-generated by our lovely just file" --reviewer cafkafk + gh pr create --draft --title "chore: release v$(convco version)" --body "This PR was auto-generated by our lovely just file" --reviewer cafkafk + @echo "Now go review that and come back and run gh-release" + +@gh-release: + git tag -a "v$(convco version --bump)" -m "auto generated by the justfile for eza v$(convco version)" + mkdir -p ./target/"release-notes-$(convco version)" + git cliff -t "v$(convco version)" -u > ./target/"release-notes-$(convco version)/RELEASE.md" ./target/"bin-$(convco version)"/* + just checksum >> ./target/"release-notes-$(convco version)/RELEASE.md" + + gh release create "v$(convco version)" --title "eza v$(convco version)" -d -F ./target/"release-notes-$(convco version)/RELEASE.md" #----------------# # binaries # @@ -187,7 +198,7 @@ alias c := cross # TODO: just binary eza.exe x86_64-pc-windows-msvc # Generate Checksums - just checksum + # TODO: moved to gh-release just checksum #---------------------# # Integration testing # diff --git a/cliff.toml b/cliff.toml index 0a882189..72c0a8ee 100644 --- a/cliff.toml +++ b/cliff.toml @@ -9,7 +9,6 @@ # changelog header header = """ # Changelog\n -All notable changes to this project will be documented in this file.\n """ # template for the changelog body # https://tera.netlify.app/docs @@ -30,7 +29,7 @@ body = """ trim = true # changelog footer footer = """ - + """ [git]