Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
kardolus
GitHub Repository: kardolus/chatgpt-cli
Path: blob/main/scripts/shipit.sh
2649 views
1
#!/usr/bin/env bash
2
set -euo pipefail
3
4
# Navigate to the project root directory
5
cd "$(dirname "${BASH_SOURCE[0]}")/.."
6
7
# Step 1: Check for tag and commit message arguments
8
if [[ $# -lt 2 ]]; then
9
echo "Error: Missing arguments. Usage: ./shipit.sh <tag> <message>"
10
exit 1
11
fi
12
13
TAG="$1"
14
MESSAGE="$2"
15
16
# Step 2: Check for unstaged changes
17
echo "Checking for unstaged changes..."
18
if ! git diff --exit-code > /dev/null; then
19
echo "Error: You have unstaged changes. Please commit or stash them before running the tests."
20
exit 1
21
fi
22
23
# Step 3: Update dependencies
24
echo "Updating dependencies..."
25
./scripts/updatedeps.sh
26
27
# Step 4: Run all tests (includes linter, 'go fmt', and 'go mod tidy')
28
echo "Running all tests..."
29
./scripts/all-tests.sh
30
31
# Step 5: Generate release notes by diffing from the latest tag to HEAD
32
echo "Generating release notes..."
33
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"
34
35
# Step 6: Create and push git tag
36
echo "Creating git tag..."
37
git tag -a "$TAG" -m "$MESSAGE"
38
git push origin --tags
39
40
# Step 7: Create binaries
41
echo "Creating binaries..."
42
./scripts/binaries.sh
43
44
echo "Release complete. Tag $TAG has been created, pushed, and binaries are ready."
45