Skip to content

Commit d90e863

Browse files
chore: update SDK settings
1 parent b57725c commit d90e863

File tree

7 files changed

+72
-29
lines changed

7 files changed

+72
-29
lines changed

.github/workflows/publish-npm.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# This workflow is triggered when a GitHub release is created.
2+
# It can also be run manually to re-publish to NPM in case it failed for some reason.
3+
# You can run this workflow by navigating to https://www.github.com/digitalocean/gradient-typescript/actions/workflows/publish-npm.yml
4+
name: Publish NPM
5+
on:
6+
workflow_dispatch:
7+
inputs:
8+
path:
9+
description: The path to run the release in, e.g. '.' or 'packages/mcp-server'
10+
required: true
11+
12+
release:
13+
types: [published]
14+
15+
jobs:
16+
publish:
17+
name: publish
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- name: Set up Node
24+
uses: actions/setup-node@v3
25+
with:
26+
node-version: '20'
27+
28+
- name: Install dependencies
29+
run: |
30+
yarn install
31+
32+
- name: Publish to NPM
33+
run: |
34+
if [ -n "${{ github.event.inputs.path }}" ]; then
35+
PATHS_RELEASED='[\"${{ github.event.inputs.path }}\"]'
36+
else
37+
PATHS_RELEASED='[\".\", \"packages/mcp-server\"]'
38+
fi
39+
yarn tsn scripts/publish-packages.ts "{ \"paths_released\": \"$PATHS_RELEASED\" }"
40+
env:
41+
NPM_TOKEN: ${{ secrets.GRADIENT_NPM_TOKEN || secrets.NPM_TOKEN }}
42+
43+
- name: Upload MCP Server DXT GitHub release asset
44+
run: |
45+
gh release upload ${{ github.event.release.tag_name }} \
46+
packages/mcp-server/digitalocean_gradient_api.dxt

.github/workflows/release-doctor.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ jobs:
1818
run: |
1919
bash ./bin/check-release-environment
2020
env:
21+
NPM_TOKEN: ${{ secrets.GRADIENT_NPM_TOKEN || secrets.NPM_TOKEN }}

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 170
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/digitalocean%2Fgradient-621c3ebf5011c5ca508f78fccbea17de4ca6b35bfe99578c1ae2265021578d6f.yml
33
openapi_spec_hash: e29d14e3e4679fcf22b3e760e49931b1
4-
config_hash: 08281b73cbc4aa830d1fa79914dc79fe
4+
config_hash: 6e3aacb34562b5a1ef74bb279f55cbec

CONTRIBUTING.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,17 @@ To format and fix all lint issues automatically:
9191
```sh
9292
$ yarn fix
9393
```
94+
95+
## Publishing and releases
96+
97+
Changes made to this repository via the automated release PR pipeline should publish to npm automatically. If
98+
the changes aren't made through the automated pipeline, you may want to make releases manually.
99+
100+
### Publish with a GitHub workflow
101+
102+
You can release to package managers by using [the `Publish NPM` GitHub action](https://www.github.com/digitalocean/gradient-typescript/actions/workflows/publish-npm.yml). This requires a setup organization or repository secret to be set up.
103+
104+
### Publish manually
105+
106+
If you need to manually release a package, you can run the `bin/publish-npm` script with an `NPM_TOKEN` set on
107+
the environment.

README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,9 @@ It is generated with [Stainless](https://www.stainless.com/).
1111
## Installation
1212

1313
```sh
14-
npm install git+ssh://git@github.com:digitalocean/gradient-typescript.git
14+
npm install @digitalocean/gradient
1515
```
1616

17-
> [!NOTE]
18-
> Once this package is [published to npm](https://www.stainless.com/docs/guides/publish), this will become: `npm install @digitalocean/gradient`
19-
2017
## Usage
2118

2219
The full API of this library can be found in [api.md](api.md).

bin/check-release-environment

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
errors=()
44

5+
if [ -z "${NPM_TOKEN}" ]; then
6+
errors+=("The NPM_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets")
7+
fi
8+
59
lenErrors=${#errors[@]}
610

711
if [[ lenErrors -gt 0 ]]; then

packages/mcp-server/README.md

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,36 +4,21 @@ It is generated with [Stainless](https://www.stainless.com/).
44

55
## Installation
66

7-
### Building
7+
### Direct invocation
88

9-
Because it's not published yet, clone the repo and build it:
9+
You can run the MCP Server directly via `npx`:
1010

1111
```sh
12-
git clone git@github.com:digitalocean/gradient-typescript.git
13-
cd gradient-typescript
14-
./scripts/bootstrap
15-
./scripts/build
16-
```
17-
18-
### Running
19-
20-
```sh
21-
# set env vars as needed
2212
export DIGITALOCEAN_ACCESS_TOKEN="My Access Token"
2313
export GRADIENT_MODEL_ACCESS_KEY="My Model Access Key"
2414
export GRADIENT_AGENT_ACCESS_KEY="My Agent Access Key"
2515
export GRADIENT_AGENT_ENDPOINT="My-Agent-Endpoint"
2616
export GRADIENT_INFERENCE_ENDPOINT="My-Inference-Endpoint"
27-
node ./packages/mcp-server/dist/index.js
17+
npx -y gradient-mcp@latest
2818
```
2919

30-
> [!NOTE]
31-
> Once this package is [published to npm](https://www.stainless.com/docs/guides/publish), this will become: `npx -y gradient-mcp`
32-
3320
### Via MCP Client
3421

35-
[Build the project](#building) as mentioned above.
36-
3722
There is a partial list of existing clients at [modelcontextprotocol.io](https://modelcontextprotocol.io/clients). If you already
3823
have a client, consult their documentation to install the MCP server.
3924

@@ -43,12 +28,8 @@ For clients with a configuration JSON, it might look something like this:
4328
{
4429
"mcpServers": {
4530
"digitalocean_gradient_api": {
46-
"command": "node",
47-
"args": [
48-
"/path/to/local/gradient-typescript/packages/mcp-server",
49-
"--client=claude",
50-
"--tools=dynamic"
51-
],
31+
"command": "npx",
32+
"args": ["-y", "gradient-mcp", "--client=claude", "--tools=dynamic"],
5233
"env": {
5334
"DIGITALOCEAN_ACCESS_TOKEN": "My Access Token",
5435
"GRADIENT_MODEL_ACCESS_KEY": "My Model Access Key",

0 commit comments

Comments
 (0)