Files
wehub-resource-sync e0e362d700
SDK Tests / changes (push) Successful in 2m29s
Real E2E Tests / changes (push) Successful in 2m29s
Deploy Docs Pages / build (push) Has been cancelled
Deploy Docs Pages / deploy (push) Has been cancelled
Real E2E Tests / JavaScript E2E (docker bridge) (push) Has been cancelled
Real E2E Tests / Python E2E (docker bridge) (push) Has been cancelled
Real E2E Tests / Java E2E (docker bridge) (push) Has been cancelled
Real E2E Tests / C# E2E (docker bridge) (push) Has been cancelled
Real E2E Tests / Go E2E (docker bridge) (push) Has been cancelled
Real E2E Tests / Real E2E CI (push) Has been cancelled
SDK Tests / SDK CI (push) Has been cancelled
SDK Tests / CLI Tests (push) Has been cancelled
SDK Tests / Python SDK Quality (code-interpreter) (push) Has been cancelled
SDK Tests / Python SDK Quality (sandbox) (push) Has been cancelled
SDK Tests / Python SDK Tests (code-interpreter) (push) Has been cancelled
SDK Tests / JavaScript SDK Quality And Tests (code-interpreter) (push) Has been cancelled
SDK Tests / JavaScript SDK Quality And Tests (sandbox) (push) Has been cancelled
SDK Tests / Python SDK Tests (sandbox) (push) Has been cancelled
SDK Tests / CLI Quality (push) Has been cancelled
SDK Tests / Kotlin SDK Quality And Tests (sandbox) (push) Has been cancelled
SDK Tests / Kotlin SDK Quality And Tests (code-interpreter) (push) Has been cancelled
SDK Tests / C# SDK Quality And Tests (code-interpreter) (push) Has been cancelled
SDK Tests / C# SDK Quality And Tests (sandbox) (push) Has been cancelled
SDK Tests / Go SDK Quality And Tests (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:39:33 +08:00

100 lines
3.0 KiB
YAML

name: Publish JavaScript SDKs
on:
push:
tags:
- "js/sandbox/v*"
- "js/code-interpreter/v*"
permissions:
contents: read
id-token: write
attestations: write
artifact-metadata: write
jobs:
release-preflight:
uses: ./.github/workflows/release-preflight.yml
publish:
needs: release-preflight
name: Publish (${{ matrix.sdk.name }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
sdk:
- name: sandbox
tagPrefix: sandbox
workingDirectory: sdks/sandbox/javascript
packageName: "@alibaba-group/opensandbox"
- name: code-interpreter
tagPrefix: code-interpreter
workingDirectory: sdks/code-interpreter/javascript
packageName: "@alibaba-group/opensandbox-code-interpreter"
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version: "20"
registry-url: "https://registry.npmjs.org"
- name: Set up pnpm
uses: pnpm/action-setup@v4
with:
version: 9.15.0
run_install: false
- name: Get pnpm store path
id: pnpm-store
working-directory: sdks
run: echo "STORE_PATH=$(pnpm store path)" >> "$GITHUB_OUTPUT"
- name: Cache pnpm store
uses: actions/cache@v5
with:
path: ${{ steps.pnpm-store.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-${{ hashFiles('sdks/pnpm-lock.yaml') }}
restore-keys: ${{ runner.os }}-pnpm-
- name: Install workspace dependencies
working-directory: sdks
run: pnpm install --frozen-lockfile
- name: Build SDK
working-directory: sdks
run: pnpm --filter ${{ matrix.sdk.packageName }}... --sort run build
- name: Pack SDK
if: startsWith(github.ref, format('refs/tags/js/{0}/v', matrix.sdk.tagPrefix))
id: pack
working-directory: ${{ matrix.sdk.workingDirectory }}
run: |
set -euo pipefail
PACK_DIR="${GITHUB_WORKSPACE}/dist/npm/${{ matrix.sdk.name }}"
mkdir -p "$PACK_DIR"
pnpm pack --pack-destination "$PACK_DIR"
PACKAGE_TARBALL="$(find "$PACK_DIR" -maxdepth 1 -name '*.tgz' -print -quit)"
if [[ -z "$PACKAGE_TARBALL" ]]; then
echo "No package tarball was produced in $PACK_DIR" >&2
exit 1
fi
echo "tarball=$PACKAGE_TARBALL" >> "$GITHUB_OUTPUT"
- name: Attest packed SDK
if: startsWith(github.ref, format('refs/tags/js/{0}/v', matrix.sdk.tagPrefix))
uses: actions/attest@v4
with:
subject-path: ${{ steps.pack.outputs.tarball }}
- name: Publish to npm
if: startsWith(github.ref, format('refs/tags/js/{0}/v', matrix.sdk.tagPrefix))
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
pnpm publish "${{ steps.pack.outputs.tarball }}" --access public --no-git-checks