TypeScript SDK Release #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: TypeScript SDK Release | |
on: | |
workflow_call: | |
secrets: | |
NPM_TOKEN: | |
description: 'NPM token' | |
required: true | |
inputs: | |
sdk_version: | |
description: 'The version to publish' | |
required: true | |
type: string | |
workflow_dispatch: | |
inputs: | |
sdk_version: | |
description: 'The version to publish' | |
required: true | |
type: string | |
jobs: | |
publish: | |
permissions: | |
contents: read | |
id-token: write | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: recursive | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '18.x' | |
registry-url: 'https://registry.npmjs.org' | |
- name: Install pre-requisites | |
uses: ./.github/actions/setup | |
# Override package.json version | |
- name: Override SDK version | |
uses: ./.github/actions/update-json | |
with: | |
file: 'sdk/typescript/package.json' | |
key: 'version' | |
value: ${{ inputs.sdk_version }} | |
- name: Publish to npm | |
continue-on-error: true # this can fail if the version is already published | |
working-directory: sdk/typescript | |
shell: bash | |
run: | | |
set -e | |
../../gradlew build | |
npm publish --provenance --access public | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |