Skip to content

Commit 31b1bab

Browse files
committed
refactor: move JS fallback to provenance workflow checkbox
Add 'js-fallback' checkbox input to provenance.yml workflow that allows publishing a JS-only fallback version when the native binary build fails. This replaces the separate workflow with an integrated option.
1 parent 4a31e8e commit 31b1bab

2 files changed

Lines changed: 29 additions & 83 deletions

File tree

.github/workflows/provenance.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ on:
1111
options:
1212
- '0'
1313
- '1'
14+
js-fallback:
15+
description: 'Publish JS-only fallback version (no native binaries)'
16+
required: false
17+
type: boolean
18+
default: false
1419
jobs:
1520
build:
1621
runs-on: ubuntu-latest
@@ -66,3 +71,27 @@ jobs:
6671
env:
6772
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
6873
SOCKET_CLI_DEBUG: ${{ inputs.debug }}
74+
75+
# Build and publish JS-only fallback version (when native binaries fail).
76+
- name: Build JS-only fallback package
77+
if: ${{ inputs.js-fallback }}
78+
working-directory: packages/cli
79+
run: pnpm run build:js
80+
- name: Validate JS-only fallback package
81+
if: ${{ inputs.js-fallback }}
82+
working-directory: packages/cli
83+
run: |
84+
# Verify build artifacts exist
85+
test -f dist/cli.js || exit 1
86+
test -f dist/npm-cli.js || exit 1
87+
test -f dist/npx-cli.js || exit 1
88+
test -f dist/pnpm-cli.js || exit 1
89+
test -f dist/yarn-cli.js || exit 1
90+
echo "✓ JS-only fallback package built successfully"
91+
- name: Publish JS-only fallback package
92+
if: ${{ inputs.js-fallback }}
93+
working-directory: packages/cli
94+
run: npm publish --provenance --access public --no-git-checks
95+
continue-on-error: true
96+
env:
97+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/publish-socket-js-fallback.yml

Lines changed: 0 additions & 83 deletions
This file was deleted.

0 commit comments

Comments
 (0)