fix: Make session creation faster #47
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
build: | |
permissions: write-all | |
name: Build Release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Validate tag matches version in main.go | |
run: | | |
# Extract version from main.go | |
VERSION=$(grep -E '^[[:space:]]*version[[:space:]]*=' main.go | sed -E 's/.*"([^"]+)".*/\1/') | |
# Get the tag name (remove refs/tags/ prefix) | |
TAG_NAME=${GITHUB_REF#refs/tags/} | |
# Remove 'v' prefix from tag if present | |
TAG_VERSION=${TAG_NAME#v} | |
echo "Version in main.go: $VERSION" | |
echo "Tag version: $TAG_VERSION" | |
# Compare versions | |
if [ "$VERSION" != "$TAG_VERSION" ]; then | |
echo "ERROR: Tag version ($TAG_VERSION) does not match version in main.go ($VERSION)" | |
echo "Please ensure the tag matches the version defined in main.go" | |
exit 1 | |
fi | |
echo "✅ Tag version matches main.go version: $VERSION" | |
- name: Set up Go 1.23 | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.23' | |
- name: Run GoReleaser | |
uses: goreleaser/goreleaser-action@v6 | |
with: | |
version: latest | |
args: release --clean | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
HOMEBREW_REPO_TOKEN: ${{ secrets.BREW_TOKEN }} |