Skip to content
35 changes: 35 additions & 0 deletions .github/workflows/typescript-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Publish Typescript code to NPM. This will use Trusted Publishing
# (https://docs.npmjs.com/trusted-publishers#supported-cicd-providers), so ensure it's set up for the calling repo.

name: Typescript Release
on:
workflow_call:
inputs:
node_version:
description: "What version of node should be used when running tests/publishing."
required: false
default: "20"
type: string
pre_publish_steps:
description: "Any steps to run before publishing begins (like `build.js; cd dist`)"
required: false
default: ""
type: string

permissions:
id-token: write # Required for OIDC
contents: read

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v6
with:
node-version: ${{ inputs.node_version }}
registry-url: "https://registry.npmjs.org"
- name: Pre-publish steps
if: ${{ inputs.pre_publish_steps }} != ""
run: ${{inputs.pre_publish_steps}}
- run: npm publish
Loading