Skip to content

docs(readme): Add env_vars for Codex CLI MCP config #28

docs(readme): Add env_vars for Codex CLI MCP config

docs(readme): Add env_vars for Codex CLI MCP config #28

Workflow file for this run

name: Release
on:
push:
branches:
- main
workflow_dispatch: # Allow manual releases
# Prevent concurrent releases
concurrency:
group: release
cancel-in-progress: false # Don't cancel in-progress releases
permissions:
contents: write
jobs:
# Run tests before release to ensure quality
test:
name: Pre-release Tests
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup Go
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
with:
go-version: '1.25.5'
cache: true
- name: Run tests
run: go test -v -race ./...
version:
name: Calculate Version
runs-on: ubuntu-latest
timeout-minutes: 5
needs: test
outputs:
version: ${{ steps.version.outputs.version }}
version_tag: ${{ steps.version.outputs.version_tag }}
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Calculate semantic version
id: version
uses: paulhatch/semantic-version@a8f8f59fd7f0625188492e945240f12d7ad2dca3 # v5.4.0
with:
tag_prefix: "v"
major_pattern: "/(BREAKING CHANGE:|feat!:)/"
minor_pattern: "feat:"
version_format: "${major}.${minor}.${patch}"
build:
name: Build ${{ matrix.goos }}/${{ matrix.goarch }}
runs-on: ubuntu-latest
timeout-minutes: 10
needs: version
strategy:
fail-fast: false # Continue building other platforms if one fails
matrix:
include:
- goos: linux
goarch: amd64
- goos: linux
goarch: arm64
- goos: darwin
goarch: amd64
- goos: darwin
goarch: arm64
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup Go
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
with:
go-version: '1.25.5'
cache: true
- name: Build binary
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
CGO_ENABLED: 0
VERSION: ${{ needs.version.outputs.version }}
run: |
go build -ldflags="-s -w -X main.version=${VERSION}" -o agentmail-${{ matrix.goos }}-${{ matrix.goarch }} ./cmd/agentmail
- name: Upload artifact
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: agentmail-${{ matrix.goos }}-${{ matrix.goarch }}
path: agentmail-${{ matrix.goos }}-${{ matrix.goarch }}
retention-days: 5
release:
name: Create Release
runs-on: ubuntu-latest
timeout-minutes: 10
needs: [version, build]
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Download all artifacts
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
path: artifacts
- name: Create Git tag
env:
VERSION: ${{ needs.version.outputs.version }}
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag -a "v${VERSION}" -m "Release v${VERSION}"
git push origin "v${VERSION}"
- name: Create GitHub Release
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0
with:
tag_name: "v${{ needs.version.outputs.version }}"
name: "v${{ needs.version.outputs.version }}"
generate_release_notes: true
files: artifacts/**/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
update-homebrew:
name: Update Homebrew Formula
runs-on: ubuntu-latest
timeout-minutes: 10
needs: [version, release]
steps:
- name: Checkout homebrew-agentmail
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
repository: UserAd/homebrew-agentmail
token: ${{ secrets.HOMEBREW_TAP_TOKEN }}
- name: Wait for release assets to be available
env:
VERSION: ${{ needs.version.outputs.version }}
run: |
# Wait for release assets to propagate (can take a few seconds)
for i in {1..12}; do
HTTP_CODE=$(curl -sL -o /dev/null -w '%{http_code}' "https://github.com/UserAd/AgentMail/releases/download/v${VERSION}/agentmail-darwin-arm64")
if [ "$HTTP_CODE" = "200" ]; then
echo "Release assets are available"
break
fi
echo "Waiting for release assets... attempt $i (HTTP $HTTP_CODE)"
sleep 10
done
- name: Download release binaries and calculate checksums
env:
VERSION: ${{ needs.version.outputs.version }}
run: |
# Download release binaries with error handling
curl -fsSL --retry 3 --retry-delay 5 "https://github.com/UserAd/AgentMail/releases/download/v${VERSION}/agentmail-darwin-amd64" -o darwin-amd64
curl -fsSL --retry 3 --retry-delay 5 "https://github.com/UserAd/AgentMail/releases/download/v${VERSION}/agentmail-darwin-arm64" -o darwin-arm64
curl -fsSL --retry 3 --retry-delay 5 "https://github.com/UserAd/AgentMail/releases/download/v${VERSION}/agentmail-linux-amd64" -o linux-amd64
curl -fsSL --retry 3 --retry-delay 5 "https://github.com/UserAd/AgentMail/releases/download/v${VERSION}/agentmail-linux-arm64" -o linux-arm64
# Verify downloads are non-empty
for f in darwin-amd64 darwin-arm64 linux-amd64 linux-arm64; do
if [ ! -s "$f" ]; then
echo "ERROR: $f is empty or missing"
exit 1
fi
done
# Calculate SHA256 checksums
echo "SHA_DARWIN_AMD64=$(sha256sum darwin-amd64 | cut -d' ' -f1)" >> $GITHUB_ENV
echo "SHA_DARWIN_ARM64=$(sha256sum darwin-arm64 | cut -d' ' -f1)" >> $GITHUB_ENV
echo "SHA_LINUX_AMD64=$(sha256sum linux-amd64 | cut -d' ' -f1)" >> $GITHUB_ENV
echo "SHA_LINUX_ARM64=$(sha256sum linux-arm64 | cut -d' ' -f1)" >> $GITHUB_ENV
- name: Update formula
env:
VERSION: ${{ needs.version.outputs.version }}
run: |
cat > Formula/agentmail.rb << 'FORMULA_EOF'
class Agentmail < Formula
desc "Inter-agent communication for tmux sessions"
homepage "https://github.com/UserAd/AgentMail"
version "VERSION_PLACEHOLDER"
license "MIT"
on_macos do
on_arm do
url "https://github.com/UserAd/AgentMail/releases/download/vVERSION_PLACEHOLDER/agentmail-darwin-arm64"
sha256 "SHA_ARM64_PLACEHOLDER"
end
on_intel do
url "https://github.com/UserAd/AgentMail/releases/download/vVERSION_PLACEHOLDER/agentmail-darwin-amd64"
sha256 "SHA_AMD64_PLACEHOLDER"
end
end
on_linux do
on_intel do
url "https://github.com/UserAd/AgentMail/releases/download/vVERSION_PLACEHOLDER/agentmail-linux-amd64"
sha256 "SHA_LINUX_AMD64_PLACEHOLDER"
end
on_arm do
url "https://github.com/UserAd/AgentMail/releases/download/vVERSION_PLACEHOLDER/agentmail-linux-arm64"
sha256 "SHA_LINUX_ARM64_PLACEHOLDER"
end
end
def install
if OS.mac?
bin.install "agentmail-darwin-arm64" => "agentmail" if Hardware::CPU.arm?
bin.install "agentmail-darwin-amd64" => "agentmail" if Hardware::CPU.intel?
else
bin.install "agentmail-linux-arm64" => "agentmail" if Hardware::CPU.arm?
bin.install "agentmail-linux-amd64" => "agentmail" if Hardware::CPU.intel?
end
end
test do
assert_match "agentmail", shell_output("#{bin}/agentmail --help")
end
end
FORMULA_EOF
# Remove leading whitespace and substitute placeholders
sed -i 's/^ //' Formula/agentmail.rb
sed -i "s/VERSION_PLACEHOLDER/${VERSION}/g" Formula/agentmail.rb
sed -i "s/SHA_ARM64_PLACEHOLDER/${SHA_DARWIN_ARM64}/g" Formula/agentmail.rb
sed -i "s/SHA_AMD64_PLACEHOLDER/${SHA_DARWIN_AMD64}/g" Formula/agentmail.rb
sed -i "s/SHA_LINUX_AMD64_PLACEHOLDER/${SHA_LINUX_AMD64}/g" Formula/agentmail.rb
sed -i "s/SHA_LINUX_ARM64_PLACEHOLDER/${SHA_LINUX_ARM64}/g" Formula/agentmail.rb
- name: Validate formula
run: |
# Ensure no placeholders remain
if grep -q 'PLACEHOLDER' Formula/agentmail.rb; then
echo "ERROR: Formula still contains unsubstituted placeholders"
cat Formula/agentmail.rb
exit 1
fi
# Verify Ruby syntax
ruby -c Formula/agentmail.rb
- name: Commit and push
env:
VERSION: ${{ needs.version.outputs.version }}
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add Formula/agentmail.rb
# Only commit if there are changes
if git diff --cached --quiet; then
echo "No changes to commit - formula already up to date"
else
git commit -m "Update agentmail to v${VERSION}"
git push
fi