Skip to content

chore: update npm publishing to use OIDC authentication (#501) #95

chore: update npm publishing to use OIDC authentication (#501)

chore: update npm publishing to use OIDC authentication (#501) #95

Workflow file for this run

name: ci
on: [push]
jobs:
compile:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Set up node
uses: actions/setup-node@v4
- name: Compile
run: yarn && yarn build
test:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Set up node
uses: actions/setup-node@v4
- name: Compile
run: yarn
- name: Test
run: yarn test
env:
INTERCOM_API_KEY: ${{ secrets.INTERCOM_API_KEY }}
publish:
needs: [ compile, test ]
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Set up node
uses: actions/setup-node@v4
- name: Install dependencies
run: yarn install
- name: Build
run: yarn build
- name: Publish to npm
run: |
publish() {
npx -y npm@latest publish "$@"
}
if [[ ${GITHUB_REF} == *alpha* ]]; then
publish --access public --tag alpha
elif [[ ${GITHUB_REF} == *beta* ]]; then
publish --access public --tag beta
else
publish --access public
fi