-
Notifications
You must be signed in to change notification settings - Fork 1
123 lines (105 loc) · 3.49 KB
/
Copy pathrelease-cli.yml
File metadata and controls
123 lines (105 loc) · 3.49 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
name: Release CLI
on:
workflow_dispatch:
inputs:
version:
description: "CLI version to release (e.g. 1.0.0)"
required: true
type: string
permissions:
contents: write
concurrency:
group: release
cancel-in-progress: false
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
test-and-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
ref: "@outlit/cli@${{ inputs.version }}"
- uses: oven-sh/setup-bun@v2
with:
bun-version: "1.3.9"
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Build tools package
working-directory: packages/tools
run: bun run build
- name: Run tests
working-directory: packages/cli
run: |
# config and client tests use real (unmocked) modules.
# Run them in their own process so mock.module() calls from
# other test files don't leak and replace the real modules.
bun test tests/lib/config.test.ts tests/lib/client.test.ts
bun test $(find tests -name '*.test.ts' \
! -path 'tests/lib/config.test.ts' \
! -path 'tests/lib/client.test.ts' | tr '\n' ' ')
- name: Build all binaries
working-directory: packages/cli
run: bun run build:all
- name: Verify binaries
working-directory: packages/cli
run: |
for f in dist/outlit-darwin-arm64 dist/outlit-darwin-x64 \
dist/outlit-linux-x64 dist/outlit-linux-arm64 \
dist/outlit-windows-x64.exe; do
[ -s "$f" ] || { echo "Missing or empty: $f"; exit 1; }
done
- name: Package archives
working-directory: packages/cli
run: |
cd dist
for bin in outlit-darwin-arm64 outlit-darwin-x64 outlit-linux-x64 outlit-linux-arm64; do
cp "$bin" outlit
chmod +x outlit
tar -czf "${bin}.tar.gz" outlit
rm outlit
done
cp outlit-windows-x64.exe outlit.exe
zip outlit-windows-x64.zip outlit.exe
rm outlit.exe
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: "@outlit/cli@${{ inputs.version }}"
name: "outlit CLI v${{ inputs.version }}"
generate_release_notes: true
body: |
## Install
**macOS / Linux**
```sh
curl -fsSL https://outlit.ai/install.sh | bash
```
**Windows (PowerShell)**
```pwsh
irm https://outlit.ai/install.ps1 | iex
```
**Homebrew**
```sh
brew install outlitai/tap/outlit
```
files: |
packages/cli/dist/outlit-darwin-arm64.tar.gz
packages/cli/dist/outlit-darwin-x64.tar.gz
packages/cli/dist/outlit-linux-x64.tar.gz
packages/cli/dist/outlit-linux-arm64.tar.gz
packages/cli/dist/outlit-windows-x64.zip
notify-tap:
name: Trigger Homebrew Tap Update
needs: test-and-build
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Dispatch publish-release workflow on tap
env:
GH_TOKEN: ${{ secrets.TAP_WORKFLOW_PAT }}
VERSION: ${{ inputs.version }}
run: |
gh workflow run publish-release.yml \
--repo OutlitAI/homebrew-tap \
--field version="$VERSION"