* feat(release): add Homebrew tap support and fix artifact naming
- Fix platform naming: binaries now named core-{os}-{arch} instead of
just 'core', preventing collision when artifacts merge
- Add tar.gz archives for non-Windows builds (Homebrew requirement)
- Add update-tap job to alpha-release workflow that auto-updates
host-uk/homebrew-tap with checksums on each alpha release
- Add homebrew publisher to .core/release.yaml for formal releases
- Update install instructions to include brew install
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat(unifi): add UniFi Go SDK integration and CLI commands
- Add pkg/unifi SDK wrapping unpoller/unifi with TLS, config resolution,
and typed accessors for sites, clients, devices, networks, and routes
- Add CLI commands: unifi sites, clients, devices, networks, routes, config
- Register unifi commands in full variant build
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix(release): set AppVersion ldflags, git config, and tap token
- Set -X pkg/cli.AppVersion in ldflags so core --version reports the
correct version instead of "dev"
- Add git config user.name/email in update-tap job so commit succeeds
- Use HOMEBREW_TAP_TOKEN secret instead of GITHUB_TOKEN for cross-repo
push to host-uk/homebrew-tap
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix(unifi): address CodeRabbit review feedback
- Reject conflicting --wired and --wireless flags in clients command
- Complete --type flag help text with bgp and ospf route types
- URL-escape site name in routes API path
- Wrap all command errors with log.E for contextual diagnostics
- Set TLS MinVersion to 1.2 on UniFi client
- Simplify redundant fmt.Sprintf in Print calls
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
223 lines
6.4 KiB
YAML
223 lines
6.4 KiB
YAML
name: Alpha Release
|
|
|
|
on:
|
|
push:
|
|
branches: [dev]
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: write
|
|
id-token: write
|
|
attestations: write
|
|
|
|
env:
|
|
# Next version - update when releasing
|
|
NEXT_VERSION: "0.0.4"
|
|
|
|
jobs:
|
|
build:
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- os: ubuntu-latest
|
|
goos: linux
|
|
goarch: amd64
|
|
- os: ubuntu-latest
|
|
goos: linux
|
|
goarch: arm64
|
|
- os: macos-latest
|
|
goos: darwin
|
|
goarch: arm64
|
|
- os: windows-latest
|
|
goos: windows
|
|
goarch: amd64
|
|
runs-on: ${{ matrix.os }}
|
|
env:
|
|
GOOS: ${{ matrix.goos }}
|
|
GOARCH: ${{ matrix.goarch }}
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
# GUI build disabled until build action supports Wails v3
|
|
# - name: Wails Build Action
|
|
# uses: host-uk/build@v4.0.0
|
|
# with:
|
|
# build-name: core
|
|
# build-platform: ${{ matrix.goos }}/${{ matrix.goarch }}
|
|
# build: true
|
|
# package: true
|
|
# sign: false
|
|
|
|
- name: Setup Go
|
|
uses: host-uk/build/actions/setup/go@v4.0.0
|
|
with:
|
|
go-version: "1.25"
|
|
|
|
- name: Build CLI
|
|
shell: bash
|
|
run: |
|
|
EXT=""
|
|
if [ "$GOOS" = "windows" ]; then EXT=".exe"; fi
|
|
BINARY="core${EXT}"
|
|
ARCHIVE_PREFIX="core-${GOOS}-${GOARCH}"
|
|
|
|
APP_VERSION="${{ env.NEXT_VERSION }}-alpha.${{ github.run_number }}"
|
|
go build -ldflags "-s -w -X github.com/host-uk/core/pkg/cli.AppVersion=${APP_VERSION}" -o "./bin/${BINARY}" .
|
|
|
|
# Create tar.gz for Homebrew (non-Windows)
|
|
if [ "$GOOS" != "windows" ]; then
|
|
tar czf "./bin/${ARCHIVE_PREFIX}.tar.gz" -C ./bin "${BINARY}"
|
|
fi
|
|
|
|
# Rename raw binary to platform-specific name for release
|
|
mv "./bin/${BINARY}" "./bin/${ARCHIVE_PREFIX}${EXT}"
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: core-${{ matrix.goos }}-${{ matrix.goarch }}
|
|
path: ./bin/core-*
|
|
|
|
release:
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
version: ${{ steps.version.outputs.version }}
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- name: Set version
|
|
id: version
|
|
run: echo "version=v${{ env.NEXT_VERSION }}-alpha.${{ github.run_number }}" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Download artifacts
|
|
uses: actions/download-artifact@v7
|
|
with:
|
|
path: dist
|
|
merge-multiple: true
|
|
|
|
- name: Prepare release files
|
|
run: |
|
|
mkdir -p release
|
|
cp dist/* release/ 2>/dev/null || true
|
|
ls -la release/
|
|
|
|
- name: Create alpha release
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
VERSION: ${{ steps.version.outputs.version }}
|
|
run: |
|
|
gh release create "$VERSION" \
|
|
--title "Alpha: $VERSION" \
|
|
--notes "Canary build from dev branch.
|
|
|
|
**Version:** $VERSION
|
|
**Commit:** ${{ github.sha }}
|
|
**Built:** $(date -u +'%Y-%m-%d %H:%M:%S UTC')
|
|
**Run:** ${{ github.run_id }}
|
|
|
|
## Channel: Alpha (Canary)
|
|
|
|
This is an automated pre-release for early testing.
|
|
|
|
- Systems and early adopters can test breaking changes
|
|
- Quality scoring determines promotion to beta
|
|
- Use stable releases for production
|
|
|
|
## Installation
|
|
|
|
\`\`\`bash
|
|
# Homebrew (macOS/Linux)
|
|
brew install host-uk/tap/core
|
|
|
|
# Direct download (example: Linux amd64)
|
|
curl -fsSL https://github.com/host-uk/core/releases/download/$VERSION/core-linux-amd64 -o core
|
|
chmod +x core && sudo mv core /usr/local/bin/
|
|
\`\`\`
|
|
" \
|
|
--prerelease \
|
|
--target dev \
|
|
release/*
|
|
|
|
update-tap:
|
|
needs: release
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Download artifacts
|
|
uses: actions/download-artifact@v7
|
|
with:
|
|
path: dist
|
|
merge-multiple: true
|
|
|
|
- name: Generate checksums
|
|
run: |
|
|
cd dist
|
|
for f in *.tar.gz; do
|
|
sha256sum "$f" | awk '{print $1}' > "${f}.sha256"
|
|
done
|
|
echo "=== Checksums ==="
|
|
cat *.sha256
|
|
|
|
- name: Update Homebrew formula
|
|
env:
|
|
GH_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}
|
|
VERSION: ${{ needs.release.outputs.version }}
|
|
run: |
|
|
# Strip leading 'v' for formula version
|
|
FORMULA_VERSION="${VERSION#v}"
|
|
|
|
# Read checksums
|
|
DARWIN_ARM64=$(cat dist/core-darwin-arm64.tar.gz.sha256)
|
|
LINUX_AMD64=$(cat dist/core-linux-amd64.tar.gz.sha256)
|
|
LINUX_ARM64=$(cat dist/core-linux-arm64.tar.gz.sha256)
|
|
|
|
# Clone tap repo
|
|
gh repo clone host-uk/homebrew-tap /tmp/tap -- --depth=1
|
|
mkdir -p /tmp/tap/Formula
|
|
|
|
# Write formula
|
|
cat > /tmp/tap/Formula/core.rb << FORMULA
|
|
# typed: false
|
|
# frozen_string_literal: true
|
|
|
|
class Core < Formula
|
|
desc "Host UK development CLI"
|
|
homepage "https://github.com/host-uk/core"
|
|
version "${FORMULA_VERSION}"
|
|
license "EUPL-1.2"
|
|
|
|
on_macos do
|
|
url "https://github.com/host-uk/core/releases/download/${VERSION}/core-darwin-arm64.tar.gz"
|
|
sha256 "${DARWIN_ARM64}"
|
|
end
|
|
|
|
on_linux do
|
|
if Hardware::CPU.arm?
|
|
url "https://github.com/host-uk/core/releases/download/${VERSION}/core-linux-arm64.tar.gz"
|
|
sha256 "${LINUX_ARM64}"
|
|
else
|
|
url "https://github.com/host-uk/core/releases/download/${VERSION}/core-linux-amd64.tar.gz"
|
|
sha256 "${LINUX_AMD64}"
|
|
end
|
|
end
|
|
|
|
def install
|
|
bin.install "core"
|
|
end
|
|
|
|
test do
|
|
system "\#{bin}/core", "--version"
|
|
end
|
|
end
|
|
FORMULA
|
|
|
|
# Remove leading whitespace from heredoc
|
|
sed -i 's/^ //' /tmp/tap/Formula/core.rb
|
|
|
|
cd /tmp/tap
|
|
git config user.name "github-actions[bot]"
|
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
git add .
|
|
git diff --cached --quiet && echo "No changes to tap" && exit 0
|
|
git commit -m "Update core to ${FORMULA_VERSION}"
|
|
git push
|