Skip to content

Release macOS CLI

Release macOS CLI #5

name: Release macOS CLI
on:
push:
tags:
- "v*"
workflow_dispatch:
inputs:
tag:
description: "Release tag to package"
required: true
type: string
permissions:
contents: write
env:
BINDHUB_DEFAULT_API_URL: https://staging-api.bindhub.dev/
BINDHUB_DEFAULT_WEB_URL: https://beta.bindhub.dev
jobs:
macos-cli:
name: macOS ${{ matrix.target }}
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
target:
- aarch64-apple-darwin
- x86_64-apple-darwin
steps:
- name: Checkout
uses: actions/checkout@v5
with:
ref: ${{ github.event.inputs.tag || github.ref_name }}
- name: Package CLI
env:
BINDHUB_RELEASE_TARGET: ${{ matrix.target }}
run: scripts/package-cli.sh "${{ github.event.inputs.tag || github.ref_name }}"
- name: Upload release assets
env:
GH_TOKEN: ${{ github.token }}
RELEASE_TAG: ${{ github.event.inputs.tag || github.ref_name }}
run: |
set -euo pipefail
assets=(
"dist/bindhub-$RELEASE_TAG-${{ matrix.target }}.tar.gz"
"dist/bindhub-$RELEASE_TAG-${{ matrix.target }}.tar.gz.sha256"
)
if gh release view "$RELEASE_TAG" >/dev/null 2>&1; then
gh release upload "$RELEASE_TAG" "${assets[@]}" --clobber
else
flags=()
case "$RELEASE_TAG" in
*-*) flags+=(--prerelease) ;;
esac
gh release create "$RELEASE_TAG" "${assets[@]}" \
--title "Bindhub CLI $RELEASE_TAG" \
--notes "Alpha command-line tools for Loom and Bindhub. The default API is https://staging-api.bindhub.dev/ and browser login opens https://beta.bindhub.dev. OAuth, signed installers, and production hardening are not included yet." \
"${flags[@]}"
fi