Skip to content
Merged
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
18 changes: 11 additions & 7 deletions .github/workflows/publishpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name: Publish packages to NPM
on:
release:
types: [created]
push:
tags:
- '**'

permissions:
id-token: write
Expand All @@ -16,14 +19,15 @@ jobs:
contents: read
packages: write
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
# Setup .npmrc file to publish
- uses: actions/setup-node@v2
- uses: actions/setup-node@v4
with:
node-version: '16.x'
node-version: 20
registry-url: 'https://registry.npmjs.org'
- name: Publish package to NPM
env:
EVENT_TYPE: ${{ github.event_name }}
IS_PRERELEASE: ${{ github.event.release.prerelease }}
run: |
echo "Update npm"
Expand All @@ -35,11 +39,11 @@ jobs:
# This step would fail if module is not a valid sdk
cd ${GITHUB_WORKSPACE}/sdk/${MODULE}

echo "Building package"
npm ci
npm run build --if-present
# echo "Building package"
# npm ci
# npm run build --if-present

if [ "$IS_PRERELEASE" = "true" ]; then
if [[ "$EVENT_TYPE" == "push" || ["$IS_PRERELEASE" == "true" ]]; then
echo "It's a pre-release."
npm publish --dry-run --access public
else
Expand Down