Publish types #92
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: Publish types | |
| on: | |
| schedule: | |
| - cron: '0 10 * * *' | |
| workflow_dispatch: | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| id-token: write | |
| defaults: | |
| run: | |
| working-directory: types | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| registry-url: 'https://registry.npmjs.org' | |
| - run: | | |
| npm install --global pnpm | |
| pnpm install | |
| - run: pnpm gen | |
| - run: pnpm format | |
| - name: Check for changes | |
| id: check_changes | |
| run: | | |
| git status --porcelain | |
| echo "changed_files=$(git status --porcelain)" >> "$GITHUB_OUTPUT" | |
| - name: Publish to npm | |
| if: steps.check_changes.outputs.changed_files != '' | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| run: | | |
| git add . | |
| npm version patch --no-git-tag-version | |
| npm publish --provenance | |
| - uses: stefanzweifel/git-auto-commit-action@v5 | |
| if: steps.check_changes.outputs.changed_files != '' | |
| with: | |
| commit_message: 'Update npm types package' |