55 tags :
66 - " v*"
77
8- permissions :
9- contents : write
10- id-token : write
8+ concurrency :
9+ group : release
10+ cancel-in-progress : false
1111
1212env :
1313 GH_REPO : AltimateAI/altimate-code
1414
1515jobs :
1616 build :
17- name : Build
17+ name : Build (${{ matrix.os }})
1818 runs-on : ubuntu-latest
19+ permissions :
20+ contents : read
21+ strategy :
22+ fail-fast : false
23+ matrix :
24+ os : [linux, darwin, win32]
1925 steps :
20- - uses : actions/checkout@v4
26+ - uses : actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
27+
28+ - uses : oven-sh/setup-bun@ecf28ddc73e819eb6fa29df6b34ef8921c743461 # v2
29+ with :
30+ bun-version : " 1.3.9"
2131
22- - uses : oven-sh/setup-bun@v2
32+ - name : Cache Bun dependencies
33+ uses : actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
34+ with :
35+ path : ~/.bun/install/cache
36+ key : bun-${{ runner.os }}-${{ hashFiles('bun.lock') }}
37+ restore-keys : |
38+ bun-${{ runner.os }}-
2339
2440 - name : Install dependencies
2541 run : bun install
2642
27- - name : Build all targets
28- run : bun run packages/altimate-code/script/build.ts
43+ - name : Build ${{ matrix.os }} targets
44+ run : bun run packages/altimate-code/script/build.ts --targets=${{ matrix.os }}
2945 env :
3046 OPENCODE_VERSION : ${{ github.ref_name }}
3147 OPENCODE_CHANNEL : latest
@@ -34,28 +50,41 @@ jobs:
3450 MODELS_DEV_API_JSON : test/tool/fixtures/models-api.json
3551
3652 - name : Upload build artifacts
37- uses : actions/upload-artifact@v4
53+ uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
3854 with :
39- name : dist
55+ name : dist-${{ matrix.os }}
4056 path : packages/altimate-code/dist/
4157
4258 publish-npm :
4359 name : Publish to npm
4460 needs : build
4561 runs-on : ubuntu-latest
62+ permissions :
63+ contents : read
4664 steps :
47- - uses : actions/checkout@v4
65+ - uses : actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
4866
49- - uses : oven-sh/setup-bun@v2
67+ - uses : oven-sh/setup-bun@ecf28ddc73e819eb6fa29df6b34ef8921c743461 # v2
68+ with :
69+ bun-version : " 1.3.9"
70+
71+ - name : Cache Bun dependencies
72+ uses : actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
73+ with :
74+ path : ~/.bun/install/cache
75+ key : bun-${{ runner.os }}-${{ hashFiles('bun.lock') }}
76+ restore-keys : |
77+ bun-${{ runner.os }}-
5078
5179 - name : Install dependencies
5280 run : bun install
5381
54- - name : Download build artifacts
55- uses : actions/download-artifact@v4
82+ - name : Download all build artifacts
83+ uses : actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
5684 with :
57- name : dist
85+ pattern : dist-*
5886 path : packages/altimate-code/dist/
87+ merge-multiple : true
5988
6089 - name : Configure npm auth
6190 run : echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
@@ -89,30 +118,33 @@ jobs:
89118 GH_REPO : ${{ env.GH_REPO }}
90119 GITHUB_TOKEN : ${{ secrets.HOMEBREW_TAP_TOKEN }}
91120
121+ # Engine publish runs without waiting for build — it builds from source and
122+ # doesn't need CLI binary artifacts. This allows it to run in parallel.
92123 publish-engine :
93124 name : Publish engine to PyPI
94- needs : build
95125 runs-on : ubuntu-latest
96126 environment : pypi
97127 permissions :
98128 contents : read
99129 id-token : write
100130 steps :
101- - uses : actions/checkout@v4
131+ - uses : actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
102132
103- - uses : actions/setup-python@v5
133+ - uses : actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
104134 with :
105135 python-version : " 3.12"
136+ cache : ' pip'
137+ cache-dependency-path : packages/altimate-engine/pyproject.toml
106138
107139 - name : Install build tools
108- run : pip install build
140+ run : pip install build==1.2.2
109141
110142 - name : Build package
111143 run : python -m build
112144 working-directory : packages/altimate-engine
113145
114146 - name : Publish to PyPI
115- uses : pypa/gh-action-pypi-publish@release/v1
147+ uses : pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # release/v1
116148 with :
117149 packages-dir : packages/altimate-engine/dist/
118150 skip-existing : true
@@ -124,7 +156,7 @@ jobs:
124156 permissions :
125157 contents : write
126158 steps :
127- - uses : actions/checkout@v4
159+ - uses : actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
128160 with :
129161 fetch-depth : 0
130162
@@ -177,14 +209,15 @@ jobs:
177209 GH_REPO : ${{ env.GH_REPO }}
178210 CURRENT_TAG : ${{ github.ref_name }}
179211
180- - name : Download build artifacts
181- uses : actions/download-artifact@v4
212+ - name : Download all build artifacts
213+ uses : actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
182214 with :
183- name : dist
215+ pattern : dist-*
184216 path : packages/altimate-code/dist/
217+ merge-multiple : true
185218
186219 - name : Create GitHub Release
187- uses : softprops/action-gh-release@v2
220+ uses : softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2
188221 with :
189222 body_path : notes.md
190223 draft : false
0 commit comments