TypeScript SDK: building automatically via workflow (#3820)
This commit is contained in:
committed by
GitHub
parent
2f87e3ab48
commit
ad2ed92e99
65
.github/workflows/ts-sdk-release.yml
vendored
Normal file
65
.github/workflows/ts-sdk-release.yml
vendored
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
name: Build Skyvern TS SDK and publish to npm
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
paths:
|
||||||
|
- 'skyvern-ts/client/package.json'
|
||||||
|
jobs:
|
||||||
|
check-version-change:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
version_changed: ${{ steps.check.outputs.version_changed }}
|
||||||
|
current_version: ${{ steps.check.outputs.current_version }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 2
|
||||||
|
- name: Check if version changed
|
||||||
|
id: check
|
||||||
|
run: |
|
||||||
|
# Get version from current package.json
|
||||||
|
CURRENT_VERSION=$(node -p "require('./skyvern-ts/client/package.json').version")
|
||||||
|
|
||||||
|
# Get version from previous commit
|
||||||
|
git checkout HEAD^1
|
||||||
|
PREVIOUS_VERSION=$(node -p "require('./skyvern-ts/client/package.json').version")
|
||||||
|
git checkout -
|
||||||
|
|
||||||
|
if [ "$CURRENT_VERSION" != "$PREVIOUS_VERSION" ]; then
|
||||||
|
echo "Version changed from $PREVIOUS_VERSION to $CURRENT_VERSION"
|
||||||
|
echo "version_changed=true" >> $GITHUB_OUTPUT
|
||||||
|
echo "current_version=$CURRENT_VERSION" >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
|
echo "Version remained at $CURRENT_VERSION"
|
||||||
|
echo "version_changed=false" >> $GITHUB_OUTPUT
|
||||||
|
echo "current_version=$CURRENT_VERSION" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
build-and-publish-sdk:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: check-version-change
|
||||||
|
if: needs.check-version-change.outputs.version_changed == 'true' || github.event_name == 'workflow_dispatch'
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
working-directory: ./skyvern-ts/client
|
||||||
|
steps:
|
||||||
|
- name: Check out Git repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: Set up Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: '18'
|
||||||
|
registry-url: 'https://registry.npmjs.org'
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm install
|
||||||
|
- name: Build CJS
|
||||||
|
run: npx tsc --project ./tsconfig.cjs.json
|
||||||
|
- name: Build ESM
|
||||||
|
run: npx tsc --project ./tsconfig.esm.json
|
||||||
|
- name: Rename ESM files
|
||||||
|
run: node scripts/rename-to-esm-files.js dist/esm
|
||||||
|
- name: Publish to npm
|
||||||
|
run: npm publish --access public
|
||||||
|
env:
|
||||||
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "skyvern"
|
name = "skyvern"
|
||||||
version = "0.2.19"
|
version = "0.2.20"
|
||||||
description = ""
|
description = ""
|
||||||
authors = [{ name = "Skyvern AI", email = "info@skyvern.com" }]
|
authors = [{ name = "Skyvern AI", email = "info@skyvern.com" }]
|
||||||
requires-python = ">=3.11,<3.14"
|
requires-python = ">=3.11,<3.14"
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
fern generate --group python-sdk --log-level debug --preview
|
CURRENT_VERSION=$(grep '^version = ' pyproject.toml | sed 's/version = "\(.*\)"/\1/')
|
||||||
|
fern generate --group python-sdk --log-level debug --version "$CURRENT_VERSION" --preview
|
||||||
cp -rf fern/.preview/fern-python-sdk/src/skyvern/* skyvern/client/
|
cp -rf fern/.preview/fern-python-sdk/src/skyvern/* skyvern/client/
|
||||||
@@ -1,4 +1,12 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
fern generate --group ts-sdk --log-level debug --preview
|
CURRENT_VERSION=$(grep '^version = ' pyproject.toml | sed 's/version = "\(.*\)"/\1/')
|
||||||
|
fern generate --group ts-sdk --log-level debug --version "$CURRENT_VERSION" --preview
|
||||||
|
|
||||||
|
(cd fern/.preview/fern-typescript-sdk \
|
||||||
|
&& npm install \
|
||||||
|
&& npx tsc --project ./tsconfig.cjs.json \
|
||||||
|
&& npx tsc --project ./tsconfig.esm.json \
|
||||||
|
&& node scripts/rename-to-esm-files.js dist/esm)
|
||||||
|
|
||||||
cp -rf fern/.preview/fern-typescript-sdk/* skyvern-ts/client/
|
cp -rf fern/.preview/fern-typescript-sdk/* skyvern-ts/client/
|
||||||
3537
skyvern-ts/client/package-lock.json
generated
Normal file
3537
skyvern-ts/client/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@skyvern/client",
|
"name": "@skyvern/client",
|
||||||
"version": "0.2.19",
|
"version": "0.2.20",
|
||||||
"private": false,
|
"private": false,
|
||||||
"repository": "github:Skyvern-AI/skyvern-typescript",
|
"repository": "github:Skyvern-AI/skyvern-typescript",
|
||||||
"type": "commonjs",
|
"type": "commonjs",
|
||||||
|
|||||||
@@ -26,8 +26,8 @@ export class SkyvernClient {
|
|||||||
"x-api-key": _options?.apiKey,
|
"x-api-key": _options?.apiKey,
|
||||||
"X-Fern-Language": "JavaScript",
|
"X-Fern-Language": "JavaScript",
|
||||||
"X-Fern-SDK-Name": "@skyvern/client",
|
"X-Fern-SDK-Name": "@skyvern/client",
|
||||||
"X-Fern-SDK-Version": "0.2.19",
|
"X-Fern-SDK-Version": "0.2.20",
|
||||||
"User-Agent": "@skyvern/client/0.2.19",
|
"User-Agent": "@skyvern/client/0.2.20",
|
||||||
"X-Fern-Runtime": core.RUNTIME.type,
|
"X-Fern-Runtime": core.RUNTIME.type,
|
||||||
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
export const SDK_VERSION = "0.2.19";
|
export const SDK_VERSION = "0.2.20";
|
||||||
|
|||||||
Reference in New Issue
Block a user