Skip to content

Commit 7582749

Browse files
authored
ci: fix release macOS cache restore (#5580)
## Summary - run macOS release smoke on GitHub-hosted macOS so it restores the GitHub-hosted build cache - keep Linux and Windows smoke tests on Blacksmith using the Blacksmith build cache - make the GitHub-hosted build available for dry-run release smoke as well as real publishes ## Context The release run after #5550 saved the Blacksmith build cache successfully, and Linux/Windows smoke restored it, but Blacksmith macOS missed the same key. The macOS smoke job now uses the cache backend produced by the GitHub-hosted build instead of relying on cross-backend visibility.
1 parent 2748803 commit 7582749

2 files changed

Lines changed: 60 additions & 7 deletions

File tree

.github/workflows/publish-preview-cli-packages.yml

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ jobs:
3939
needs.build.result == 'success'
4040
name: Publish preview package
4141
runs-on: blacksmith-8vcpu-ubuntu-2404
42+
outputs:
43+
preview_url: ${{ steps.preview-metadata.outputs.preview_url }}
4244
env:
4345
PREVIEW_VERSION: 0.0.0-pr.${{ github.event.pull_request.number }}
4446
PR_NUMBER: ${{ github.event.pull_request.number }}
@@ -86,12 +88,30 @@ jobs:
8688
'./packages/cli-windows-x64' \
8789
'./apps/cli'
8890
91+
- name: Read preview package metadata
92+
id: preview-metadata
93+
run: |
94+
set -euo pipefail
95+
preview_url="$(
96+
node -e "
97+
const fs = require('node:fs');
98+
const metadata = JSON.parse(fs.readFileSync('pkg-pr-new.json', 'utf8'));
99+
const pkg = metadata.packages.find((entry) => entry.name === 'supabase');
100+
if (!pkg?.url) {
101+
throw new Error('pkg-pr-new.json did not include a supabase package URL');
102+
}
103+
console.log(pkg.url);
104+
"
105+
)"
106+
echo "Preview command: npx --yes ${preview_url}"
107+
echo "preview_url=${preview_url}" >> "${GITHUB_OUTPUT}"
108+
89109
- name: Smoke test preview command
110+
env:
111+
PREVIEW_URL: ${{ steps.preview-metadata.outputs.preview_url }}
90112
run: |
91113
set -euo pipefail
92-
preview_url="https://pkg.pr.new/supabase@${PR_NUMBER}"
93-
echo "Preview command: npx ${preview_url}"
94-
npx --yes "${preview_url}" --version
114+
npx --yes "${PREVIEW_URL}" --version
95115
96116
comment:
97117
needs: publish
@@ -107,13 +127,13 @@ jobs:
107127
GH_TOKEN: ${{ github.token }}
108128
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
109129
PR_NUMBER: ${{ github.event.pull_request.number }}
130+
PREVIEW_URL: ${{ needs.publish.outputs.preview_url }}
110131
steps:
111132
- name: Post preview command comment
112133
run: |
113134
set -euo pipefail
114135
115136
marker="<!-- supabase-cli-preview-package -->"
116-
preview_url="https://pkg.pr.new/supabase@${PR_NUMBER}"
117137
short_sha="${HEAD_SHA:0:7}"
118138
comment_file="$(mktemp)"
119139
@@ -122,7 +142,7 @@ jobs:
122142
## Supabase CLI preview
123143
124144
\`\`\`sh
125-
npx --yes ${preview_url}
145+
npx --yes ${PREVIEW_URL}
126146
\`\`\`
127147
128148
_Preview package for commit [\`${short_sha}\`](https://github.com/${GITHUB_REPOSITORY}/commit/${HEAD_SHA})._

.github/workflows/release-shared.yml

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ jobs:
6767

6868
build-github:
6969
name: Build CLI artifacts (GitHub hosted)
70-
if: ${{ !inputs.dry_run }}
7170
uses: ./.github/workflows/build-cli-artifacts.yml
7271
with:
7372
version: ${{ inputs.version }}
@@ -87,7 +86,6 @@ jobs:
8786
matrix:
8887
runner:
8988
- blacksmith-8vcpu-ubuntu-2404
90-
- blacksmith-6vcpu-macos-latest
9189
- blacksmith-8vcpu-windows-2025
9290
runs-on: ${{ matrix.runner }}
9391
env:
@@ -189,10 +187,45 @@ jobs:
189187
run: pnpm run test:smoke -- --version "${VERSION}" --tag "${NPM_TAG}"
190188
working-directory: apps/cli
191189

190+
smoke-test-macos:
191+
needs:
192+
- build-github
193+
runs-on: macos-latest
194+
env:
195+
NPM_TAG: ${{ inputs.npm_tag }}
196+
VERSION: ${{ inputs.version }}
197+
steps:
198+
- name: Checkout
199+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
200+
with:
201+
persist-credentials: false
202+
203+
- name: Setup
204+
uses: ./.github/actions/setup
205+
206+
- name: Restore build artifacts cache
207+
uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
208+
with:
209+
path: |
210+
packages/cli-*/bin/
211+
dist/
212+
key: cli-build-${{ github.run_id }}-${{ inputs.shell }}-${{ inputs.version }}-github-v1
213+
enableCrossOsArchive: true
214+
fail-on-cache-miss: true
215+
216+
- name: Fix binary permissions
217+
run: chmod +x packages/cli-*/bin/supabase || true
218+
219+
- name: Run smoke tests
220+
shell: bash
221+
run: pnpm run test:smoke -- --version "${VERSION}" --tag "${NPM_TAG}"
222+
working-directory: apps/cli
223+
192224
publish:
193225
needs:
194226
- build-github
195227
- smoke-test
228+
- smoke-test-macos
196229
if: ${{ !inputs.dry_run }}
197230
# npm provenance verification rejects non-GitHub-hosted runners with
198231
# E422 ("Unsupported GitHub Actions runner environment: self-hosted").

0 commit comments

Comments
 (0)