Skip to content

Commit b961182

Browse files
committed
[codecane] Replace hardcoded NEXT_PUBLIC_* env vars with dynamic collection and remove SSH debug sessions from CI
1 parent ac98f55 commit b961182

File tree

2 files changed

+6
-52
lines changed

2 files changed

+6
-52
lines changed

.github/workflows/cli-release-build.yml

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -170,13 +170,6 @@ jobs:
170170
OVERRIDE_PLATFORM: ${{ matrix.platform }}
171171
OVERRIDE_ARCH: ${{ matrix.arch }}
172172

173-
- name: Open debug shell after build
174-
if: always()
175-
uses: mxschmitt/action-tmate@v3
176-
with:
177-
limit-access-to-actor: true
178-
timeout-minutes: 15
179-
180173
- name: Smoke test binary
181174
if: matrix.smoke_test != false
182175
shell: bash
@@ -203,13 +196,6 @@ jobs:
203196
name: codecane-${{ matrix.target }}
204197
path: codecane-${{ matrix.target }}.tar.gz
205198

206-
- name: Open debug shell on failure
207-
if: failure()
208-
uses: mxschmitt/action-tmate@v3
209-
with:
210-
limit-access-to-actor: true
211-
timeout-minutes: 15
212-
213199
build-windows-binary:
214200
runs-on: windows-latest
215201
steps:
@@ -327,13 +313,6 @@ jobs:
327313
OVERRIDE_PLATFORM: win32
328314
OVERRIDE_ARCH: x64
329315

330-
- name: Open debug shell after build
331-
if: always()
332-
uses: mxschmitt/action-tmate@v3
333-
with:
334-
limit-access-to-actor: true
335-
timeout-minutes: 15
336-
337316
- name: Smoke test binary
338317
shell: bash
339318
run: |
@@ -351,10 +330,3 @@ jobs:
351330
with:
352331
name: codecane-win32-x64
353332
path: codecane-win32-x64.tar.gz
354-
355-
- name: Open debug shell on failure
356-
if: failure()
357-
uses: mxschmitt/action-tmate@v3
358-
with:
359-
limit-access-to-actor: true
360-
timeout-minutes: 15

cli/scripts/build-binary.ts

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,11 @@ async function main() {
138138
targetInfo.platform === 'win32' ? `${binaryName}.exe` : binaryName
139139
const outputFile = join(binDir, outputFilename)
140140

141+
// Collect all NEXT_PUBLIC_* environment variables
142+
const nextPublicEnvVars = Object.entries(process.env)
143+
.filter(([key]) => key.startsWith('NEXT_PUBLIC_'))
144+
.map(([key, value]) => [`process.env.${key}`, `"${value ?? ''}"`])
145+
141146
const defineFlags = [
142147
['process.env.NODE_ENV', '"production"'],
143148
['process.env.CODEBUFF_IS_BINARY', '"true"'],
@@ -146,30 +151,7 @@ async function main() {
146151
'process.env.CODEBUFF_CLI_TARGET',
147152
`"${targetInfo.platform}-${targetInfo.arch}"`,
148153
],
149-
[
150-
'process.env.NEXT_PUBLIC_CB_ENVIRONMENT',
151-
`"${process.env.NEXT_PUBLIC_CB_ENVIRONMENT ?? 'prod'}"`,
152-
],
153-
[
154-
'process.env.NEXT_PUBLIC_CODEBUFF_APP_URL',
155-
`"${process.env.NEXT_PUBLIC_CODEBUFF_APP_URL ?? 'https://www.codebuff.com'}"`,
156-
],
157-
[
158-
'process.env.NEXT_PUBLIC_CODEBUFF_BACKEND_URL',
159-
`"${process.env.NEXT_PUBLIC_CODEBUFF_BACKEND_URL ?? 'manicode-backend.onrender.com'}"`,
160-
],
161-
[
162-
'process.env.NEXT_PUBLIC_SUPPORT_EMAIL',
163-
`"${process.env.NEXT_PUBLIC_SUPPORT_EMAIL ?? 'support@codebuff.com'}"`,
164-
],
165-
[
166-
'process.env.NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY',
167-
`"${process.env.NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY ?? 'pk_live_51Q0SA5KrNS6SjmqWMgRE0ar5v6cMvtizkyY3mXjYaZsU6AG9ctpNPKZMVf6xFK2ngqwkt8rHNIQgNiCFSbRdGb9Z00QEo13rfx'}"`,
168-
],
169-
[
170-
'process.env.NEXT_PUBLIC_STRIPE_CUSTOMER_PORTAL',
171-
`"${process.env.NEXT_PUBLIC_STRIPE_CUSTOMER_PORTAL ?? 'https://billing.stripe.com/p/login/cN22bea8W6Ra2is144'}"`,
172-
],
154+
...nextPublicEnvVars,
173155
]
174156

175157
const buildArgs = [

0 commit comments

Comments
 (0)