-
Notifications
You must be signed in to change notification settings - Fork 0
153 lines (120 loc) · 3.72 KB
/
release.yml
File metadata and controls
153 lines (120 loc) · 3.72 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
152
153
name: Release
on:
push:
tags:
- "v*"
jobs:
publish-npm:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v6
- name: Install dependencies
run: ./bun install
# web-assets.generated.ts is produced by `build:web` and is gitignored.
# Lint/typecheck/tests transitively import it through packages/cli/serve/.
# Running the bundler alone (no Vite) emits an empty-map stub, which
# satisfies the type shape without a full UI build.
- name: Prepare embedded web assets (stub)
run: ./bun scripts/bundle-web-assets.ts
- name: Typecheck
run: ./bun run typecheck
- name: Lint
run: ./bun run lint
- name: Test (unit)
run: find packages -name '*.test.ts' ! -name '*.integration.test.ts' -print0 | xargs -0 ./bun test
- name: Build @memory.build/protocol
run: ./bun run --filter '@memory.build/protocol' build
- name: Build @memory.build/client
run: ./bun run --filter '@memory.build/client' build
- name: Publish @memory.build/protocol
run: cd packages/protocol && ../../bun x 'npm@>=11.5.1' publish --access public
- name: Publish @memory.build/client
run: cd packages/client && ../../bun x 'npm@>=11.5.1' publish --access public
build-cli:
# Build on macOS so the darwin binary can be ad-hoc signed.
# Unsigned Bun-compiled darwin binaries are killed by macOS at launch.
runs-on: macos-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v6
- name: Install dependencies
run: ./bun install
- name: Build CLI (all platforms)
run: ./bun run build:all
- name: Generate checksums
run: |
cd dist
for file in me-*; do
shasum -a 256 "$file" > "${file}.sha256"
done
- name: Upload CLI artifacts
uses: actions/upload-artifact@v5
with:
name: me-binaries
path: dist/me-*
release-cli:
runs-on: ubuntu-latest
needs: build-cli
permissions:
contents: write
steps:
- uses: actions/checkout@v6
- name: Download CLI artifacts
uses: actions/download-artifact@v5
with:
name: me-binaries
path: ./dist
- name: List artifacts
run: ls -la ./dist
- name: Create GitHub Release
uses: softprops/action-gh-release@v3
with:
files: ./dist/*
generate_release_notes: true
publish-cli-npm:
runs-on: ubuntu-latest
needs: build-cli
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v6
- name: Download CLI artifacts
uses: actions/download-artifact@v5
with:
name: me-binaries
path: ./dist
- name: List artifacts
run: ls -la ./dist
- name: Publish to npm
run: |
./bun run scripts/npm/publish.ts \
--version "${GITHUB_REF_NAME#v}" \
--binaries-dir ./dist
publish-homebrew:
runs-on: ubuntu-latest
needs:
- build-cli
- release-cli
permissions:
contents: read
steps:
- uses: actions/checkout@v6
- name: Download CLI artifacts
uses: actions/download-artifact@v5
with:
name: me-binaries
path: ./dist
- name: List artifacts
run: ls -la ./dist
- name: Update Homebrew formula
env:
HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}
run: |
./bun run scripts/brew/update-formula.ts \
--version "${GITHUB_REF_NAME#v}" \
--binaries-dir ./dist