Skip to content

RCnet v2 (Revision 5) #82

RCnet v2 (Revision 5)

RCnet v2 (Revision 5) #82

name: Publish TypeScript Gateway SDK
on:
workflow_dispatch:
inputs:
package_version_number:
description: "Package version number"
required: true
release:
types: [published]
jobs:
publish-gateway-sdk-npmjs:
runs-on: ubuntu-22.04
defaults:
run:
working-directory: ./sdk/typescript
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
- uses: ./.github/actions/fetch-secrets
with:
role_name: "arn:aws:iam::308190735829:role/gh-babylon-gateway-secrets-read-access"
app_name: "babylon-gateway"
step_name: "publish-gateway-sdk-npmjs"
secret_prefix: "NPM"
secret_name: "github-actions/radixdlt/babylon-gateway/npm-publishing-secret"
parse_json: true
- name: Use Node.js
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516
with:
node-version: "18.x"
registry-url: "https://registry.npmjs.org"
env:
NODE_AUTH_TOKEN: ${{ env.NPM_TOKEN }}
- run: cat $NPM_CONFIG_USERCONFIG
- name: Build alphanet-gateway-sdk
run: |
npm ci
npm run build
npm run test
- name: Setup tags for npm
id: setup_tags
uses: ./.github/actions/set-variables
with:
github_event_name: ${{ github.event_name }}
github_action_name: ${{ github.event.action}}
- name: Update package.json version
uses: jossef/action-set-json-field@2a0f7d953b580b828717daf4de7fafc7e4135e97
with:
file: ./sdk/typescript/package.json
field: version
value: ${{ github.event.inputs.package_version_number || steps.setup_tags.outputs.version-tag }}
- run: |
npm config set access public
npm publish
env:
NODE_AUTH_TOKEN: ${{ env.NPM_TOKEN }}