Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions .github/workflows/npm-publish-cloud.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# This workflow will run tests using node and then publish a package to npm when a release is created
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages

name: publish-cloud-to-npm

on:
release:
types: [published]
jobs:
build:
if: github.event.release.target_commitish == 'main'
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'
node-version: '18.18.0'
- name: Setup yarn
run: npm install -g yarn
- name: Compare package.json version with tag
run: |
TAG_VERSION=${GITHUB_REF#refs/tags/}
Expand All @@ -39,10 +40,11 @@ jobs:
run: yarn install --frozen-lockfile
- name: Publish package
run: |
publish() {
npx -y npm@latest publish "$@"
}
if [ "$is_next" = "true" ]; then
yarn publish --tag preview
publish --tag preview
else
yarn publish
publish
fi
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}