Skip to content

Release 1.3.0

Release 1.3.0 #19

Workflow file for this run

name: Release
permissions:
contents: write
on:
workflow_dispatch:
push:
tags:
- "[0-9]*"
jobs:
build-and-package:
name: Build and package (${{ matrix.name }})
strategy:
matrix:
include:
- name: linux-amd64
GOOS: linux
GOARCH: amd64
runs-on: ubuntu-latest
- name: linux-arm64
GOOS: linux
GOARCH: arm64
runs-on: ubuntu-latest
- name: darwin-amd64
GOOS: darwin
GOARCH: amd64
runs-on: macos-latest
- name: darwin-arm64
GOOS: darwin
GOARCH: arm64
runs-on: macos-latest
- name: windows-amd64
GOOS: windows
GOARCH: amd64
runs-on: windows-latest
runs-on: ${{ matrix.runs-on }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.24.4'
- name: Get version
shell: bash
run: echo "VERSION=$(make version)" >> $GITHUB_ENV
- name: Build binaries
shell: bash
env:
GOOS: ${{ matrix.GOOS }}
GOARCH: ${{ matrix.GOARCH }}
CGO_ENABLED: '0'
run: |
make -j
set -euo pipefail
mkdir -p dist
declare -a PKGS=(
"src/repl/mai-repl"
"src/wmcp/mai-wmcp"
"src/tool/mai-tool"
"src/vdb/mai-vdb"
"src/bot/mai-bot"
"src/mcps/code/mai-mcp-code"
"src/mcps/pancode/mai-mcp-pancode"
"src/mcps/wttr/mai-mcp-wttr"
"src/mcps/pipe/mai-mcp-pipe"
"src/mcps/shell/mai-mcp-shell"
"src/mcps/time/mai-mcp-time"
"src/mcps/markdown/mai-mcp-markdown"
)
for pkg in "${PKGS[@]}"; do
out="${pkg##*/}"
outpath="dist/$out"
if [ "$GOOS" = "windows" ]; then
outpath+='.exe'
fi
cp -f "./$pkg" "./$outpath"
done
- name: Package into single directory
shell: bash
run: |
set -euo pipefail
PKGDIR=package/mai
rm -rf package artifacts || true
mkdir -p "$PKGDIR"
for f in dist/*; do
cp "$f" "$PKGDIR/"
done
# Ensure executables have execute bit on unix
if [ "${{ matrix.GOOS }}" != "windows" ]; then
chmod +x "$PKGDIR"/* || true
fi
mkdir -p artifacts
zipname="artifacts/mai-${{ matrix.GOOS }}-${{ matrix.GOARCH }}-${{ env.VERSION }}.zip"
if [ "${{ matrix.GOOS }}" = "windows" ]; then
powershell.exe -Command "Compress-Archive -Path '$PKGDIR' -DestinationPath '$zipname'"
else
(cd package && zip -r -q "../$zipname" mai)
fi
ls -la artifacts
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: mai-${{ matrix.GOOS }}-${{ matrix.GOARCH }}-${{ env.VERSION }}
path: artifacts/mai-${{ matrix.GOOS }}-${{ matrix.GOARCH }}-${{ env.VERSION }}.zip
- name: Create GitHub release and upload assets
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: artifacts/*.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}