SDKgen #119
This file contains hidden or 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
| name: SDKgen | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| typehub_message: | |
| description: "The TypeHub commit message on commit" | |
| required: false | |
| typehub_version: | |
| description: "The TypeHub version on tag" | |
| required: false | |
| typehub_changelog: | |
| description: "The TypeHub changelog on tag" | |
| required: false | |
| permissions: | |
| id-token: write # Required for OIDC | |
| contents: write | |
| jobs: | |
| generate: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: apioo/sdkgen-generator-action@v0.2.1 | |
| with: | |
| client_id: '${{ secrets.SDKGEN_CLIENT_ID }}' | |
| client_secret: '${{ secrets.SDKGEN_CLIENT_SECRET }}' | |
| typehub_message: '${{ inputs.typehub_message }}' | |
| typehub_version: '${{ inputs.typehub_version }}' | |
| typehub_changelog: '${{ inputs.typehub_changelog }}' | |
| publish: | |
| if: "${{ inputs.typehub_version != '' }}" | |
| needs: generate | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v3 | |
| with: | |
| node-version: '22.x' | |
| registry-url: 'https://registry.npmjs.org' | |
| - run: npm install -g npm@latest | |
| - run: npm version ${{ inputs.typehub_version }} --no-git-tag-version | |
| - run: npm install | |
| - run: node ./build_index.js | |
| - run: npm run build --if-present | |
| - run: npm publish --access public | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |