obm/.github/workflows/release.yml
MermaidMan 21f2bd3a9d feat: add curl|sh one-liner install script
- Add scripts/install.sh for easy installation via curl
- Auto-detects OS (linux, darwin, windows) and arch (amd64, arm64)
- Supports version pinning: sh -s -- v1.2.3
- Installs to /usr/local/bin or ~/.local/bin as fallback
- Updates release workflow to include install.sh in release assets
- Adds README.md with installation documentation
2026-05-22 15:43:19 +00:00

162 lines
No EOL
4.6 KiB
YAML

name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
build:
name: Build binaries
runs-on: ubuntu-latest
strategy:
matrix:
include:
# Linux
- goos: linux
goarch: amd64
platform: linux-amd64
- goos: linux
goarch: arm64
platform: linux-arm64
# macOS (Apple Silicon only)
- goos: darwin
goarch: arm64
platform: darwin-arm64
# Windows
- goos: windows
goarch: amd64
platform: windows-amd64
- goos: windows
goarch: arm64
platform: windows-arm64
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
cache: true
- name: Get version
id: version
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Build binary
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
CGO_ENABLED: 0
run: |
VERSION=${{ steps.version.outputs.VERSION }}
BINARY_NAME="obm"
if [ "$GOOS" = "windows" ]; then
BINARY_NAME="obm.exe"
fi
LDFLAGS="-s -w -X main.version=$VERSION"
GOOS=$GOOS GOARCH=$GOARCH go build -ldflags "$LDFLAGS" -o "$BINARY_NAME" ./cmd/obm
- name: Create archive
run: |
BINARY_NAME="obm"
if [ "${{ matrix.goos }}" = "windows" ]; then
BINARY_NAME="obm.exe"
zip -j "obm-${{ matrix.platform }}.zip" "$BINARY_NAME"
else
tar -czf "obm-${{ matrix.platform }}.tar.gz" "$BINARY_NAME"
fi
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: obm-${{ matrix.platform }}
path: |
obm-${{ matrix.platform }}.tar.gz
obm-${{ matrix.platform }}.zip
retention-days: 1
if-no-files-found: warn
release:
name: Create Release
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get version
id: version
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: List artifacts
run: find artifacts -type f
- name: Create checksums
run: |
cd artifacts
find . -type f \( -name "*.tar.gz" -o -name "*.zip" \) -exec sha256sum {} \; > ../checksums.txt
cat ../checksums.txt
- name: Get install script
run: |
cp scripts/install.sh install.sh
chmod +x install.sh
- name: Create Release
uses: softprops/action-gh-release@v1
with:
name: Release ${{ steps.version.outputs.VERSION }}
body: |
## obm ${{ steps.version.outputs.VERSION }}
OpenBoatMobile CLI tool for deploying AI agent infrastructure.
### Platforms
- `linux-amd64` - Linux (x86_64)
- `linux-arm64` - Linux (ARM64/AArch64)
- `darwin-arm64` - macOS (Apple Silicon)
- `windows-amd64` - Windows (x86_64)
- `windows-arm64` - Windows (ARM64)
### Installation
**One-liner (Linux/macOS):**
```bash
curl -fsSL https://raw.githubusercontent.com/openboatmobile/obm/main/scripts/install.sh | sh
```
Or install a specific version:
```bash
curl -fsSL https://raw.githubusercontent.com/openboatmobile/obm/main/scripts/install.sh | sh -s -- v1.2.3
```
**Manual download:**
Download the archive for your platform, extract, and place `obm` in your PATH.
### Usage
```bash
obm --help
obm deploy # Interactive deployment wizard
obm validate # Validate configuration
obm status # Check infrastructure health
```
files: |
artifacts/**/obm-*.tar.gz
artifacts/**/obm-*.zip
checksums.txt
install.sh
draft: false
prerelease: ${{ contains(steps.version.outputs.VERSION, '-') }}
generate_release_notes: false