Skip to content

Commit

Permalink
Publish to npm for new sdk versions
Browse files Browse the repository at this point in the history
If the API or the sdk templates increment their version we want to
publish a copy of the package to npm.

The GitHub action we are using here (npm-publish) claims that it will
only publish if the package version has changed from the published
version.

Issue #497 Integrate SDK generation into build process
  • Loading branch information
slifty committed Feb 6, 2024
1 parent f563059 commit e461498
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,19 @@ jobs:
path: 'sdk'
- name: Copy API definition
run: cp service/src/openapi.json sdk/openapi.json
- name: Invoke the typescript generator
- name: Invoke the TypeScript generator
working-directory: sdk
run: ./gradlew generateSwaggerCode
- name: Install dependencies for the typescript sdk
- name: Install dependencies for the TypeScript SDK
working-directory: sdk/build/typescript
run: npm ci
- name: Build the typescript sdk
- name: Build the TypeScript SDK
working-directory: sdk/build/typescript
run: npm run build
- name: Publish to NPM if there is a new version
uses: JS-DevTools/npm-publish@v3
with:
package: sdk/build/typescript
token: ${{ secrets.NPM_TOKEN }}
access: public
dry-run: ${{ github.event_name == 'pull_request' }}

0 comments on commit e461498

Please sign in to comment.