File tree Expand file tree Collapse file tree 3 files changed +47
-6
lines changed Expand file tree Collapse file tree 3 files changed +47
-6
lines changed Original file line number Diff line number Diff line change
1
+ name : Create releases
2
+ on :
3
+ schedule :
4
+ - cron : ' 0 5 * * *' # every day at 5am UTC
5
+ push :
6
+ branches :
7
+ - main
8
+
9
+ jobs :
10
+ release :
11
+ name : release
12
+ if : github.ref == 'refs/heads/main' && github.repository == 'anthropics/anthropic-sdk-typescript'
13
+ runs-on : ubuntu-latest
14
+ environment : production-release
15
+
16
+ steps :
17
+ - uses : actions/checkout@v4
18
+
19
+ - uses : stainless-api/trigger-release-please@v1
20
+ id : release
21
+ with :
22
+ repo : ${{ github.event.repository.full_name }}
23
+ stainless-api-key : ${{ secrets.STAINLESS_API_KEY }}
24
+
25
+ - name : Set up Node
26
+ if : ${{ steps.release.outputs.releases_created }}
27
+ uses : actions/setup-node@v3
28
+ with :
29
+ node-version : ' 18'
30
+
31
+ - name : Install dependencies
32
+ if : ${{ steps.release.outputs.releases_created }}
33
+ run : |
34
+ yarn install
35
+
36
+ - name : Publish to NPM
37
+ if : ${{ steps.release.outputs.releases_created }}
38
+ run : |
39
+ yarn tsn scripts/publish-packages.ts
40
+
41
+ env :
42
+ DATA : ${{ toJSON(steps.release.outputs) }}
43
+ NPM_TOKEN : ${{ secrets.ANTHROPIC_NPM_TOKEN || secrets.NPM_TOKEN }}
44
+
Original file line number Diff line number Diff line change 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/anthropics/anthropic-sdk-typescript/actions/workflows/publish-npm.yml
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/anthropics/anthropic-sdk-typescript/actions/workflows/publish-npm.yml
4
3
name : Publish NPM
5
4
on :
6
5
workflow_dispatch :
9
8
description : The path to run the release in, e.g. '.' or 'packages/vertex-sdk'
10
9
required : true
11
10
12
- release :
13
- types : [published]
14
-
15
11
jobs :
16
12
publish :
17
13
name : publish
Original file line number Diff line number Diff line change 19
19
run : |
20
20
bash ./bin/check-release-environment
21
21
env :
22
+ STAINLESS_API_KEY : ${{ secrets.STAINLESS_API_KEY }}
22
23
NPM_TOKEN : ${{ secrets.ANTHROPIC_NPM_TOKEN || secrets.NPM_TOKEN }}
23
24
You can’t perform that action at this time.
0 commit comments