build(release): improve release automation

Signed-off-by: Christina Sørensen <christina@cafkafk.com>
This commit is contained in:
Christina Sørensen 2023-10-04 13:29:27 +02:00
parent 79e2ed19d8
commit 094ca8fe10
No known key found for this signature in database
GPG Key ID: 26C542FD97F965CE
2 changed files with 19 additions and 9 deletions

View File

@ -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 #

View File

@ -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 = """
<!-- generated by git-cliff -->
"""
[git]