From 570b9daca7736163113201621e2ddf8a39722b44 Mon Sep 17 00:00:00 2001 From: kardolus Date: Tue, 5 Nov 2024 22:10:09 +0100 Subject: [PATCH] Touch up --- docs/release_procedures.md | 4 ++-- scripts/shipit.sh | 26 +++++++++++++------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/docs/release_procedures.md b/docs/release_procedures.md index 463d777..d983036 100644 --- a/docs/release_procedures.md +++ b/docs/release_procedures.md @@ -5,7 +5,7 @@ Execute the Ship-It script to prepare the release: ```shell -make shipit version=v1.0.0 message="bla bla" +make shipit version=v1.2.3 message="in this release we changed xyz" ``` ## 2. Create a GitHub release @@ -13,7 +13,7 @@ make shipit version=v1.0.0 message="bla bla" Use the release notes generated by the `shipit` script when creating a new GitHub release. The `shipit` script also creates the binaries required for the release in the `./bin` folder. -## 4. Bump the version +## 3. Bump the version 1. Update the URL and sha256 in the Homebrew formula (`kardolus/homebrew-chatgpt-cli/HomebrewFormula/chatgpt-cli.rb`). 2. Calculate the sha256 of the new tar file using: diff --git a/scripts/shipit.sh b/scripts/shipit.sh index d87c8d6..6cf5663 100755 --- a/scripts/shipit.sh +++ b/scripts/shipit.sh @@ -4,30 +4,30 @@ set -euo pipefail # Navigate to the project root directory cd "$(dirname "${BASH_SOURCE[0]}")/.." -# Step 1: Check for unstaged changes +# Step 1: Check for tag and commit message arguments +if [[ $# -lt 2 ]]; then + echo "Error: Missing arguments. Usage: ./shipit.sh " + exit 1 +fi + +TAG="$1" +MESSAGE="$2" + +# Step 2: Check for unstaged changes echo "Checking for unstaged changes..." if ! git diff --exit-code > /dev/null; then echo "Error: You have unstaged changes. Please commit or stash them before running the tests." exit 1 fi -# Step 2: Update dependencies +# Step 3: Update dependencies echo "Updating dependencies..." ./scripts/updatedeps.sh -# Step 3: Run all tests (includes linter, 'go fmt', and 'go mod tidy') +# Step 4: Run all tests (includes linter, 'go fmt', and 'go mod tidy') echo "Running all tests..." ./scripts/all-tests.sh -# Step 4: Check for tag and commit message arguments -if [[ $# -lt 2 ]]; then - echo "Error: Missing arguments. Usage: ./shipit.sh " - exit 1 -fi - -TAG="$1" -MESSAGE="$2" - # Step 5: Create and push git tag echo "Creating git tag..." git tag -a "$TAG" -m "$MESSAGE" @@ -39,6 +39,6 @@ echo "Creating binaries..." # Step 7: Generate release notes by diffing from the latest tag to HEAD echo "Generating release notes..." -git diff $(git rev-list --tags --max-count=1)..HEAD -- . ":(exclude)vendor" | chatgpt -n -p ../prompts/write_release_notes.md for the 'how to update' section explain you can use brew upgrade chatgpt-cli or do a direct download of the binaries for your specific OS. The version we are releasing is "$TAG" +git diff "$(git rev-list --tags --max-count=1)"..HEAD -- . ":(exclude)vendor" | chatgpt -n -p ../prompts/write_release_notes.md for the 'how to update' section explain you can use brew upgrade chatgpt-cli or do a direct download of the binaries for your specific OS. The version we are releasing is "$TAG" echo "Release complete. Tag $TAG has been created, pushed, and binaries are ready." \ No newline at end of file