-
Notifications
You must be signed in to change notification settings - Fork 2.1k
64 lines (54 loc) · 1.53 KB
/
typescript-sdk-publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: 'Publish TypeScript SDK'
on:
push:
branches:
- 'main'
paths:
- 'typescript-sdk/**'
tags:
- 'typescript-sdk-v*'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
defaults:
run:
shell: bash
working-directory: './typescript-sdk'
env:
ACTIONS_RUNNER_DEBUG: true
NODE_OPTIONS: '--no-warnings'
jobs:
publish-sdk:
name: 'Publish to Registries'
runs-on: ['ubuntu-latest']
permissions:
contents: read
# The OIDC ID token is used for authentication with JSR.
id-token: write
steps:
- name: 'Checkout'
uses: actions/checkout@v4
- name: 'Setup bun'
uses: oven-sh/setup-bun@v2
with:
bun-version: 'latest'
registry-url: 'https://registry.npmjs.org'
- name: 'Install Dependencies'
run: bun install
- name: 'Prechecks'
run: |
bun run build
bun run typecheck
bun run check-package
- name: 'Publish to JSR'
run: bun scripts/publish.ts --period patch
- name: 'Publish to NPM'
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
BUN_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npm publish --access='public' --no-git-tags