Skip to content

Build and Deploy Type Definitions Only #194

Build and Deploy Type Definitions Only

Build and Deploy Type Definitions Only #194

Workflow file for this run

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