Skip to content

fix(installer): pin phase 3 CLI release #6

fix(installer): pin phase 3 CLI release

fix(installer): pin phase 3 CLI release #6

name: Harness CLI Release
on:
push:
tags:
- "v*"
- "harness-cli-v*"
workflow_dispatch:
inputs:
release_tag:
description: "Existing or new GitHub Release tag to upload artifacts to"
required: false
type: string
permissions:
contents: write
env:
CARGO_TERM_COLOR: always
jobs:
verify:
name: Verify
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Check formatting
run: cargo fmt --check
- name: Run tests
run: cargo test --workspace
- name: Check shell scripts
run: |
bash -n scripts/install-harness.sh
bash -n scripts/harness
bash -n scripts/build-harness-cli-release.sh
build:
name: Build ${{ matrix.platform }}
needs: verify
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- platform: macos-arm64
target: aarch64-apple-darwin
runner: macos-15
- platform: macos-x64
target: x86_64-apple-darwin
runner: macos-15-intel
- platform: linux-x64
target: x86_64-unknown-linux-gnu
runner: ubuntu-24.04
- platform: linux-arm64
target: aarch64-unknown-linux-gnu
runner: ubuntu-24.04-arm
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Build release artifact
run: scripts/build-harness-cli-release.sh --target "${{ matrix.target }}"
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: harness-cli-${{ matrix.platform }}
path: |
dist/harness-cli-${{ matrix.platform }}
dist/harness-cli-${{ matrix.platform }}.sha256
if-no-files-found: error
publish:
name: Publish GitHub Release
needs: build
runs-on: ubuntu-24.04
if: ${{ github.event_name == 'push' || github.event.inputs.release_tag != '' }}
env:
GH_TOKEN: ${{ github.token }}
RELEASE_TAG: ${{ github.event.inputs.release_tag || github.ref_name }}
steps:
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
pattern: harness-cli-*
merge-multiple: true
path: dist
- name: Create release if needed
run: |
gh release view "$RELEASE_TAG" --repo "$GITHUB_REPOSITORY" >/dev/null 2>&1 ||
gh release create "$RELEASE_TAG" \
--repo "$GITHUB_REPOSITORY" \
--title "$RELEASE_TAG" \
--notes "Harness CLI release $RELEASE_TAG"
- name: Upload release assets
run: gh release upload "$RELEASE_TAG" dist/harness-cli-* --repo "$GITHUB_REPOSITORY" --clobber