Explorar o código

build(release): improve release automation

Signed-off-by: Christina Sørensen <christina@cafkafk.com>
Christina Sørensen %!s(int64=2) %!d(string=hai) anos
pai
achega
094ca8fe10
Modificáronse 2 ficheiros con 19 adicións e 9 borrados
  1. 18 7
      Justfile
  2. 1 2
      cliff.toml

+ 18 - 7
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 #

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