Skip to content

Commit 68d54e5

Browse files
author
meorphis
committed
chore(internal): add back release workflow
1 parent cc31518 commit 68d54e5

File tree

3 files changed

+47
-6
lines changed

3 files changed

+47
-6
lines changed

.github/workflows/create-releases.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
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+

.github/workflows/publish-npm.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
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
43
name: Publish NPM
54
on:
65
workflow_dispatch:
@@ -9,9 +8,6 @@ on:
98
description: The path to run the release in, e.g. '.' or 'packages/vertex-sdk'
109
required: true
1110

12-
release:
13-
types: [published]
14-
1511
jobs:
1612
publish:
1713
name: publish

.github/workflows/release-doctor.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@ jobs:
1919
run: |
2020
bash ./bin/check-release-environment
2121
env:
22+
STAINLESS_API_KEY: ${{ secrets.STAINLESS_API_KEY }}
2223
NPM_TOKEN: ${{ secrets.ANTHROPIC_NPM_TOKEN || secrets.NPM_TOKEN }}
2324

0 commit comments

Comments
 (0)