mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-08-31 00:03:01 +03:00
68 lines
1.7 KiB
YAML
68 lines
1.7 KiB
YAML
name: Publish Terminal UI
|
|
|
|
on:
|
|
release:
|
|
types: [published]
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
build:
|
|
name: ${{ matrix.target }}
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 15
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
target:
|
|
- darwin-arm64
|
|
- darwin-x64
|
|
- linux-arm64
|
|
- linux-x64
|
|
- win32-x64
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Bun
|
|
uses: oven-sh/setup-bun@v2
|
|
with:
|
|
bun-version: 1.3.13
|
|
|
|
- name: Install dependencies
|
|
working-directory: tui
|
|
run: bun install --frozen-lockfile
|
|
|
|
- name: Install ${{ matrix.target }} native dependencies
|
|
working-directory: tui
|
|
run: bun scripts/prepare-target.ts ${{ matrix.target }}
|
|
|
|
- name: Build ${{ matrix.target }}
|
|
working-directory: tui
|
|
run: bun run build -- ${{ matrix.target }}
|
|
|
|
- name: Ad-hoc sign macOS executable
|
|
if: startsWith(matrix.target, 'darwin-')
|
|
uses: indygreg/apple-code-sign-action@44d0985b7f4363198e80b6fea63ac3e9dd3e9957 # v1
|
|
with:
|
|
input_path: tui/dist/nanobot-tui-${{ matrix.target }}
|
|
rcodesign_version: 0.29.0
|
|
|
|
- name: Refresh signed checksum
|
|
working-directory: tui/dist
|
|
shell: bash
|
|
env:
|
|
TARGET: ${{ matrix.target }}
|
|
run: |
|
|
asset="nanobot-tui-${TARGET}"
|
|
if [[ "$TARGET" == win32-* ]]; then asset="${asset}.exe"; fi
|
|
sha256sum "$asset" > "${asset}.sha256"
|
|
|
|
- name: Upload release assets
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
TAG: ${{ github.event.release.tag_name }}
|
|
shell: bash
|
|
run: gh release upload "$TAG" tui/dist/nanobot-tui-* --clobber
|