Skip to content

Commit 3a2d3d3

Browse files
committed
fix(release): share one poll budget across brew tarballs and pin the brew jobs
1 parent 769f493 commit 3a2d3d3

3 files changed

Lines changed: 9 additions & 2 deletions

File tree

‎.changeset/brew-native-formula.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
'@pymodel/pythinker-code': minor
33
---
44

5-
Homebrew installs the native `pythinker` binary on macOS and Linux and no longer requires Node.js; a Homebrew install updates only through `brew upgrade`.
5+
Homebrew now installs the native `pythinker` binary on macOS and Linux, without Node.js.

‎scripts/release/release-workflows.test.mjs‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ void test('release workflow uses full push-boundary lane signals and isolated jo
3232
assert.match(workflow, /APPLE_CERTIFICATE_P12: \$\{\{ secrets\.MAC_CSC_LINK \}\}/u);
3333
assert.match(workflow, /APPLE_NOTARIZATION_KEY_P8: \$\{\{ secrets\.APPLE_API_KEY_P8 \}\}/u);
3434
assert.match(workflow, /^ update-brew-tap:\n timeout-minutes: 20$/mu);
35+
const brewJob = workflow.slice(workflow.indexOf(' update-brew-tap:'), workflow.indexOf(' verify-brew-install:'));
36+
assert.match(brewJob, /needs:\n - release\n - publish-native-assets\n/u);
37+
assert.match(workflow, /^ verify-brew-install:/mu);
38+
assert.match(workflow, /BREW_RESULT: \$\{\{ needs\.verify-brew-install\.result \}\}/u);
3539
});
3640

3741
void test('VS Code release supports isolated recovery and attests verified VSIX files', () => {

‎scripts/release/update-brew-formula.mjs‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,9 @@ async function main() {
137137
const packageJson = JSON.parse(readFileSync(new URL('../../apps/pythinker-code/package.json', import.meta.url), 'utf8'));
138138
const version = packageJson.version;
139139

140+
// One budget for all four tarballs, so the poll always ends inside the
141+
// job's timeout.
142+
const deadline = Date.now() + ASSET_POLL_BUDGET_MS;
140143
const assets = {};
141144
for (const target of Object.values(BREW_TARGETS)) {
142145
const url = nativeTarballUrl(version, target);
@@ -148,7 +151,7 @@ async function main() {
148151
setTimeout(resolve, ms);
149152
}),
150153
now: () => Date.now(),
151-
budgetMs: ASSET_POLL_BUDGET_MS,
154+
budgetMs: Math.max(0, deadline - Date.now()),
152155
intervalMs: ASSET_POLL_INTERVAL_MS,
153156
});
154157
assets[target] = { url, sha256: createHash('sha256').update(body).digest('hex') };

0 commit comments

Comments
 (0)