Skip to content

Commit 5395b96

Browse files
committed
feat: add npm logic
1 parent 951b328 commit 5395b96

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

.github/workflows/release.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
on:
2-
# push:
3-
# branches: [ main, 4.x ]
2+
push:
3+
branches: [ main ]
44
workflow_dispatch: {}
55

66
permissions:
@@ -13,11 +13,22 @@ jobs:
1313
release-please:
1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: google-github-actions/release-please-action@v3
16+
- id: release
17+
uses: google-github-actions/release-please-action@v3
1718
with:
1819
release-type: node
1920
package-name: mongodb
20-
plugins: mongodb
2121
pull-request-title-pattern: 'chore${scope}: release${component} ${version} [skip-ci]'
2222
changelog-path: HISTORY.md
23-
default-branch: main # This setting is so that running the workflow against this WIP branch will still use main for search for releases
23+
default-branch: main
24+
25+
# If release-please created a release, publish to npm
26+
- if: ${{ steps.release.outputs.release_created }}
27+
uses: actions/checkout@v3
28+
- if: ${{ steps.release.outputs.release_created }}
29+
name: setup
30+
uses: ./.github/actions/setup.yml
31+
- if: ${{ steps.release.outputs.release_created }}
32+
run: npm publish --provenance
33+
env:
34+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)