Created
April 26, 2023 07:58
-
-
Save prokopsimek/95617ab7ad720d5b1dc7bfd864ad1ec5 to your computer and use it in GitHub Desktop.
Automating SDK releases on Github Action
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will publish a package to npmjs.com when a release is created | |
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages | |
name: Node.js Package | |
on: push | |
jobs: | |
publish-npm: | |
if: "github.ref == 'refs/heads/main' && github.event_name == 'push' && contains(github.event.head_commit.message, 'chore(release)')" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
registry-url: https://registry.npmjs.org/ | |
- name: Build SDK # for custom build or when using TypeScript | |
run: npm run build | |
- name: Publish to NPM | |
- run: npm publish --access public | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment