diff --git a/.github/workflows/publishpackage.yml b/.github/workflows/publishpackage.yml index e71b9d9..66c6672 100644 --- a/.github/workflows/publishpackage.yml +++ b/.github/workflows/publishpackage.yml @@ -3,6 +3,9 @@ name: Publish packages to NPM on: release: types: [created] + push: + tags: + - '**' permissions: id-token: write @@ -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" @@ -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