-
Notifications
You must be signed in to change notification settings - Fork 0
136 lines (110 loc) · 3.73 KB
/
Copy pathrelease.yml
File metadata and controls
136 lines (110 loc) · 3.73 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
name: Release
on:
push:
tags:
- "v*"
- "[0-9]*"
permissions:
contents: write
jobs:
build:
name: Build (${{ matrix.os }})
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
binary: app-linux
- os: macos-latest
binary: app-mac
- os: windows-latest
binary: app-win.exe
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}
- uses: dart-lang/setup-dart@v1
with:
sdk: stable
- name: Install dependencies
run: dart pub get
- name: Compile
shell: bash
run: dart compile exe bin/commandcode_bridge.dart -o ${{ matrix.binary }}
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.binary }}
path: ${{ matrix.binary }}
package:
name: Package tarball
needs: build
runs-on: ubuntu-latest
if: ${{ !contains(github.ref_name, '-rc') && !contains(github.ref_name, '-beta') && !contains(github.ref_name, '-alpha') }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}
- uses: actions/setup-node@v4
with:
node-version: "22"
- name: Download binaries
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Stage binaries
shell: bash
run: |
cp artifacts/app-linux/app-linux app-linux
cp artifacts/app-mac/app-mac app-mac
cp artifacts/app-win.exe/app-win.exe app-win.exe
chmod 755 app-linux app-mac
ls -la app-linux app-mac app-win.exe
- name: Package tarball
shell: bash
run: |
node scripts/stage-npm-package.mjs --out .
- name: Verify tarball
shell: bash
run: |
TGZ=$(ls commandcode-bridge-*.tgz)
echo "Tarball: $TGZ"
tar tzf "$TGZ"
- uses: actions/upload-artifact@v4
with:
name: tarball
path: commandcode-bridge-*.tgz
release:
name: Create GitHub release
needs: [build, package]
runs-on: ubuntu-latest
if: ${{ !contains(github.ref_name, '-rc') && !contains(github.ref_name, '-beta') && !contains(github.ref_name, '-alpha') }}
steps:
- uses: actions/download-artifact@v4
with:
name: tarball
- name: Create release
uses: softprops/action-gh-release@v2
with:
name: ${{ github.ref_name }}
files: commandcode-bridge-*.tgz
body: |
## What's in ${{ github.ref_name }}
See [CHANGELOG.md](https://github.com/${{ github.repository }}/blob/main/CHANGELOG.md) for full details.
## Installation
```bash
# Download the .tgz asset below, then:
npm install -g ./commandcode-bridge-${{ github.ref_name }}.tgz
# Run the bridge
commandcode-bridge run # TUI mode
commandcode-bridge run --server # Headless server mode
# Update when a new release is out
commandcode-bridge update
```
### Why not `npm install -g Khip01/commandcode-bridge#${{ github.ref_name }}`?
npm v11 has a bug installing global git deps: the install appears to succeed but the `commandcode-bridge` binary is missing. Always install from a local tarball. See [Git-Based NPM Install/Distribution Workflow](https://opencode.ai) for the full story.
## Requirements
- Node.js 18+ (for the npm launcher)
- A Command Code account with active plan
- `cmd login` to authenticate (one-time)
No Dart SDK needed.