Skip to content

Commit a8da56f

Browse files
chore(internal): fix release workflows
1 parent 340461b commit a8da56f

File tree

3 files changed

+53
-0
lines changed

3 files changed

+53
-0
lines changed

.github/workflows/create-releases.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<<<<<<< HEAD
12
name: Create releases
23
on:
34
schedule:
@@ -44,3 +45,49 @@ jobs:
4445
env:
4546
DATA: ${{ toJSON(steps.release.outputs) }}
4647
NPM_TOKEN: ${{ secrets.ANTHROPIC_NPM_TOKEN || secrets.NPM_TOKEN }}
48+
||||||| parent of a5a56bc (chore(internal): fix release workflows)
49+
=======
50+
name: Create releases
51+
on:
52+
schedule:
53+
- cron: '0 5 * * *' # every day at 5am UTC
54+
push:
55+
branches:
56+
- main
57+
58+
jobs:
59+
release:
60+
name: release
61+
if: github.ref == 'refs/heads/main' && github.repository == 'anthropics/anthropic-sdk-typescript'
62+
runs-on: ubuntu-latest
63+
environment: production-release
64+
65+
steps:
66+
- uses: actions/checkout@v4
67+
68+
- uses: stainless-api/trigger-release-please@v1
69+
id: release
70+
with:
71+
repo: ${{ github.event.repository.full_name }}
72+
stainless-api-key: ${{ secrets.STAINLESS_API_KEY }}
73+
74+
- name: Set up Node
75+
if: ${{ steps.release.outputs.releases_created }}
76+
uses: actions/setup-node@v3
77+
with:
78+
node-version: '20'
79+
80+
- name: Install dependencies
81+
if: ${{ steps.release.outputs.releases_created }}
82+
run: |
83+
yarn install
84+
85+
- name: Publish to NPM
86+
if: ${{ steps.release.outputs.releases_created }}
87+
run: |
88+
yarn tsn scripts/publish-packages.ts
89+
90+
env:
91+
DATA: ${{ toJSON(steps.release.outputs) }}
92+
NPM_TOKEN: ${{ secrets.ANTHROPIC_NPM_TOKEN || secrets.NPM_TOKEN }}
93+
>>>>>>> a5a56bc (chore(internal): fix release workflows)

.github/workflows/publish-npm.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
# you can run this workflow by navigating to https://www.github.com/anthropics/anthropic-sdk-typescript/actions/workflows/publish-npm.yml
33
name: Publish NPM
44
on:
5+
6+
57
workflow_dispatch:
68
inputs:
79
path:

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 "${STAINLESS_API_KEY}" ]; then
6+
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.")
7+
fi
8+
59
if [ -z "${NPM_TOKEN}" ]; then
610
errors+=("The ANTHROPIC_NPM_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets")
711
fi

0 commit comments

Comments
 (0)