-
Notifications
You must be signed in to change notification settings - Fork 42
151 lines (130 loc) · 4.52 KB
/
build-cli.yml
File metadata and controls
151 lines (130 loc) · 4.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
name: Build CLI
on:
push:
branches:
- installer
workflow_dispatch:
inputs:
version:
description: 'Version tag (e.g., v1.0.0)'
required: true
type: string
jobs:
build:
name: Build CLI for ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
include:
- os: ubuntu-latest
platform: linux
arch: x86_64
target: bun-linux-x64
binary_name: deadend-cli
- os: macos-latest
platform: macos
arch: aarch64
target: bun-darwin-arm64
binary_name: deadend-cli
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install dependencies
working-directory: cli/deadend
run: bun install --frozen-lockfile
- name: Build CLI binary
working-directory: cli/deadend
run: |
bun build --compile \
--target=${{ matrix.target }} \
--outfile ${{ matrix.binary_name }} \
index.ts
- name: Create package directory
id: package
working-directory: cli/deadend
run: |
PACKAGE_NAME="deadend-cli-${{ matrix.platform }}-${{ matrix.arch }}"
mkdir -p "$PACKAGE_NAME"
cp ${{ matrix.binary_name }} "$PACKAGE_NAME/"
echo "name=$PACKAGE_NAME" >> $GITHUB_OUTPUT
echo "binary=${{ matrix.binary_name }}" >> $GITHUB_OUTPUT
- name: Create archive
working-directory: cli/deadend
run: |
tar -czf "${{ steps.package.outputs.name }}.tar.gz" "${{ steps.package.outputs.name }}"
- name: Create checksum
working-directory: cli/deadend
run: |
if command -v sha256sum >/dev/null 2>&1; then
sha256sum "${{ steps.package.outputs.name }}.tar.gz" > "${{ steps.package.outputs.name }}.tar.gz.sha256"
else
shasum -a 256 "${{ steps.package.outputs.name }}.tar.gz" > "${{ steps.package.outputs.name }}.tar.gz.sha256"
fi
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: deadend-cli-${{ matrix.platform }}-${{ matrix.arch }}
path: |
cli/deadend/${{ steps.package.outputs.name }}.tar.gz
cli/deadend/${{ steps.package.outputs.name }}.tar.gz.sha256
retention-days: 30
release:
name: Create Release
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch'
permissions:
contents: write
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Determine version
id: version
shell: bash
run: |
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
VERSION="${{ github.event.inputs.version }}"
else
VERSION="${GITHUB_REF#refs/tags/}"
fi
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Version: $VERSION"
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Create release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.version.outputs.version }}
name: CLI Release ${{ steps.version.outputs.version }}
body: |
## Deadend CLI ${{ steps.version.outputs.version }}
### What's changed ?
- [x] Rewrote CLI from Deno/React to Bun/OpenTUI
- [x] Adding LLM error handling in the CLI.
- [x] Adding interruption feature to stop the agent at any time.
- [x] Handling and verify Ollama cloud models.
### Downloads
**Linux (x86_64):**
- `deadend-cli-linux-x86_64.tar.gz`
**macOS (ARM64):**
- `deadend-cli-macos-aarch64.tar.gz`
### Installation
Download and run the install script:
```bash
curl -fsSL https://raw.githubusercontent.com/${{ github.repository }}/main/install.sh | bash -s -- --version ${{ steps.version.outputs.version }}
```
files: |
artifacts/**/*
draft: false
prerelease: ${{ contains(steps.version.outputs.version, '-') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}