Skip to content

Commit 5c68c60

Browse files
feat(api): manual updates
1 parent d849bff commit 5c68c60

6 files changed

+55
-4
lines changed

.github/workflows/create-releases.yml

+7
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,10 @@ jobs:
3232
run: |
3333
yarn install
3434
35+
- name: Publish to NPM
36+
if: ${{ steps.release.outputs.releases_created }}
37+
run: |
38+
bash ./bin/publish-npm
39+
env:
40+
NPM_TOKEN: ${{ secrets.GITPOD_NPM_TOKEN || secrets.NPM_TOKEN }}
41+

.github/workflows/publish-npm.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# workflow for re-running publishing to NPM in case it fails for some reason
2+
# you can run this workflow by navigating to https://www.github.com/gitpod-io/gitpod-sdk-typescript/actions/workflows/publish-npm.yml
3+
name: Publish NPM
4+
on:
5+
workflow_dispatch:
6+
7+
jobs:
8+
publish:
9+
name: publish
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Set up Node
16+
uses: actions/setup-node@v3
17+
with:
18+
node-version: '18'
19+
20+
- name: Install dependencies
21+
run: |
22+
yarn install
23+
24+
- name: Publish to NPM
25+
run: |
26+
bash ./bin/publish-npm
27+
env:
28+
NPM_TOKEN: ${{ secrets.GITPOD_NPM_TOKEN || secrets.NPM_TOKEN }}

.github/workflows/release-doctor.yml

+1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@ jobs:
1919
bash ./bin/check-release-environment
2020
env:
2121
STAINLESS_API_KEY: ${{ secrets.STAINLESS_API_KEY }}
22+
NPM_TOKEN: ${{ secrets.GITPOD_NPM_TOKEN || secrets.NPM_TOKEN }}
2223

CONTRIBUTING.md

+14
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/gitpod-io/gitpod-sdk-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

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

1313
```sh
14-
npm install git+ssh://[email protected]:gitpod-io/gitpod-sdk-typescript.git
14+
npm install @gitpod/sdk
1515
```
1616

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

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

bin/check-release-environment

+4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ if [ -z "${STAINLESS_API_KEY}" ]; then
66
errors+=("The STAINLESS_API_KEY secret has not been set. Please contact Stainless for an API key & set it in your organization secrets on GitHub.")
77
fi
88

9+
if [ -z "${NPM_TOKEN}" ]; then
10+
errors+=("The GITPOD_NPM_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets")
11+
fi
12+
913
lenErrors=${#errors[@]}
1014

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

0 commit comments

Comments
 (0)