Skip to content

chore: update to use OIDC publishing (#368) #43

chore: update to use OIDC publishing (#368)

chore: update to use OIDC publishing (#368) #43

name: Release Please
on:
push:
branches:
- main
workflow_dispatch:
inputs:
dry-run:
description: 'Is this a dry run. If so no package will be published.'
type: boolean
required: true
prerelease:
description: 'Is this a prerelease. If so, then the latest tag will not be updated in npm.'
type: boolean
required: true
jobs:
release-please:
if: github.event_name == 'push'
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
steps:
- uses: googleapis/release-please-action@v4
id: release
with:
token: ${{secrets.GITHUB_TOKEN}}
publish-package:
runs-on: ubuntu-latest
needs: ['release-please']
if: ${{ needs.release-please.outputs.release_created == 'true' }}
permissions:
id-token: write
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24.x
registry-url: 'https://registry.npmjs.org'
- name: Update NPM
shell: bash
# Must be greater than 11.5.1 for OIDC.
run: npm install -g [email protected]
- name: Install Dependencies
run: npm install
# Publishing will build because we have a prepublish script.
- id: publish-npm
name: Publish NPM Package
uses: ./.github/actions/publish-npm
with:
dry-run: 'false'
prerelease: 'false'
- name: Build Documentation
run: npm run doc
- id: publish-docs
name: Publish Documentation
uses: ./.github/actions/publish-docs
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
manual-publish-package:
runs-on: ubuntu-latest
if: github.event_name == 'workflow_dispatch'
permissions:
id-token: write
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24.x
registry-url: 'https://registry.npmjs.org'
- name: Update NPM
shell: bash
# Must be greater than 11.5.1 for OIDC.
run: npm install -g [email protected]
- name: Install Dependencies
run: npm install
- id: publish-npm
name: Publish NPM Package
uses: ./.github/actions/publish-npm
with:
dry-run: ${{ inputs.dry-run }}
prerelease: ${{ inputs.prerelease }}