-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add shared JS SDK GitHub Actions workflow
- Loading branch information
1 parent
75d2eff
commit d0ef614
Showing
3 changed files
with
65 additions
and
30 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: Build JS SDK | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- synchronize | ||
- reopened | ||
paths: | ||
- 'packages/sdk/js/**' | ||
|
||
jobs: | ||
build: | ||
uses: ./.github/workflows/js-sdk-shared.yaml | ||
with: | ||
should-publish: false |
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Build and Publish JS SDK Package | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
should-publish: | ||
required: false | ||
type: boolean | ||
default: false | ||
|
||
jobs: | ||
build: | ||
name: Build and optionally publish SDK to NPM | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '16.x' | ||
registry-url: 'https://registry.npmjs.org' | ||
cache: npm | ||
cache-dependency-path: package-lock.json | ||
|
||
- name: Install dependencies | ||
working-directory: ./packages/sdk/js/ | ||
run: npm ci | ||
|
||
- name: Build package | ||
working-directory: ./packages/sdk/js/ | ||
run: npm run build | ||
|
||
- name: Publish package | ||
if: ${{ inputs.should-publish }} | ||
run: npm publish --access=public | ||
working-directory: ./packages/sdk/js/ | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
- name: Release | ||
if: ${{ inputs.should-publish }} | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
generate_release_notes: true |