Skip to content

publish npm packages #1868

publish npm packages

publish npm packages #1868

name: Publish npm packages
on:
# manually triggering the workflow if desired
workflow_dispatch:
# trigger this workflow when the CI workflow is completed
workflow_run:
workflows: ["Continuous Integration"]
branches: [main]
types:
- completed
jobs:
publish-npm-packages:
# check that the CI workflow was actually successful
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
environment: npm
steps:
- uses: actions/checkout@v3
- name: Setup Pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Install dependencies
run: pnpm install
- name: Install Doppler CLI for env variables
uses: dopplerhq/cli-action@v2
- run: doppler run -- pnpm build
env:
DOPPLER_TOKEN: ${{ secrets.DOPPLER_PRODUCTION_ENV_TOKEN }}
- name: Set publishing config
run: pnpm config set '//registry.npmjs.org/:_authToken' "${NPM_AUTH_TOKEN}" && pnpm config set 'git-checks' false
env:
NPM_AUTH_TOKEN: ${{secrets.NPM_PUBLISH_TOKEN}}
- name: create and publish versions
run: pnpm --filter !vs-code-extension publish -r