Build and Deploy Type Definitions Only #194
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: Build and Deploy Type Definitions Only | |
| on: | |
| workflow_run: | |
| workflows: ["Build"] | |
| types: | |
| - completed | |
| workflow_dispatch: | |
| concurrency: | |
| group: build-types | |
| cancel-in-progress: true | |
| jobs: | |
| deploy-types: | |
| if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout Repo | |
| uses: actions/checkout@v6 | |
| with: | |
| ref: dist | |
| - name: Copy type definitions | |
| run: | | |
| cp ./dist/vql.d.ts ./vql.d.ts | |
| - name: Prepare package.json | |
| run: | | |
| jq 'del( | |
| .scripts, | |
| .devDependencies, | |
| .dependencies, | |
| .peerDependencies, | |
| .peerDependenciesMeta, | |
| .main, | |
| .files, | |
| .homepage | |
| ) + { "types": "./vql.d.ts" }' package.json > tmp.package.json | |
| mv tmp.package.json package.json | |
| - name: Push to `types` branch | |
| run: | | |
| git config --global user.name "github-actions[bot]" | |
| git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
| git checkout --orphan types | |
| git reset -q HEAD -- | |
| git add LICENSE vql.d.ts package.json | |
| git commit -m "Deploy type definitions only" | |
| git push origin types --force |