Skip to content

chore: Update changelog #4

chore: Update changelog

chore: Update changelog #4

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*.*.*'
permissions:
contents: write
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install mise
uses: jdx/mise-action@v2
- name: Run tests
run: mise run test
release:
needs: test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate changelog
uses: orhun/git-cliff-action@v4
with:
config: cliff.toml
args: --latest --strip header
env:
OUTPUT: CHANGELOG_RELEASE.md
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
name: "mint ${{ github.ref_name }}"
body_path: CHANGELOG_RELEASE.md
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Update Homebrew Formula
run: |
# Clone the tap repository
git clone https://x-access-token:${{ secrets.HOMEBREW_TAP_TOKEN }}@github.com/mybuddymichael/homebrew-tap.git tap
cd tap
# Configure git
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
# Calculate SHA256 checksum for the source archive
TARBALL_URL="https://github.com/mybuddymichael/mint/archive/refs/tags/${{ github.ref_name }}.tar.gz"
# Wait for GitHub to process the release
sleep 10
SHA256=$(curl -sL "$TARBALL_URL" | shasum -a 256 | cut -d' ' -f1)
# Verify we got a valid SHA256
if [[ ! "$SHA256" =~ ^[a-f0-9]{64}$ ]]; then
echo "Error: Invalid SHA256 checksum: $SHA256"
exit 1
fi
echo "Calculated SHA256: $SHA256"
# Create new formula content for source build
cat > mint.rb << EOF
# typed: false
# frozen_string_literal: true
class Mint < Formula
desc "A (very) simple command line tool to track work on a software project."
homepage "https://github.com/mybuddymichael/mint"
url "https://github.com/mybuddymichael/mint/archive/${{ github.ref_name }}.tar.gz"
sha256 "$SHA256"
version "${{ github.ref_name }}".delete_prefix("v")
license "MIT"
head do
url "https://github.com/mybuddymichael/mint.git", branch: "main"
end
depends_on "go" => :build
def install
system "go", "build", "-trimpath", *std_go_args(output: bin/"mint", ldflags: "-s -w -X main.version=${{ github.ref_name }}"), "."
generate_completions_from_executable(bin/"mint", "completion")
end
test do
# Test that binary exists and is executable
assert_predicate bin/"mint", :exist?
assert_predicate bin/"mint", :executable?
# Test help command
assert_match "agent memory", shell_output("#{bin}/mint help")
end
end
EOF
# Commit and push changes
git add mint.rb
git commit -m "Update mint to ${{ github.ref_name }}"
git push origin main