From d88e059b10f0f38304d45b841083cdab9f013657 Mon Sep 17 00:00:00 2001 From: Sarah Schulte Date: Sat, 4 Mar 2023 15:01:20 -0800 Subject: [PATCH] add workflow to build and deploy typescript declarations --- .github/workflows/deploy-typescript-npm.yml | 34 +++++++++++++++++++++ npm-types/package.json | 25 +++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 .github/workflows/deploy-typescript-npm.yml create mode 100644 npm-types/package.json diff --git a/.github/workflows/deploy-typescript-npm.yml b/.github/workflows/deploy-typescript-npm.yml new file mode 100644 index 0000000..ea42cca --- /dev/null +++ b/.github/workflows/deploy-typescript-npm.yml @@ -0,0 +1,34 @@ +name: Deploy NPM Typescript + +# Controls when the workflow will run +on: + # Triggers the workflow on push or pull request events but only for the "main" branch + # specifically, when the 'eventsub_subscriptions.json' file has changed + push: + branches: [ "main" ] + paths: [ "eventsub_subscriptions.json" ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: '16.x' + registry-url: 'https://registry.npmjs.org' + + # build the package + - uses: cgsdev0/tau-types-action@v1 + with: + output-file: npm-types/index.d.ts + + # push to npm + - run: npm publish + working-directory: npm-types + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/npm-types/package.json b/npm-types/package.json new file mode 100644 index 0000000..0cff42d --- /dev/null +++ b/npm-types/package.json @@ -0,0 +1,25 @@ +{ + "name": "tau-types", + "version": "0.0.1", + "description": "Typescript definitions for TAU", + "main": "", + "repository": { + "type": "git", + "url": "git+https://github.com/Team-TAU/tau.git" + }, + "keywords": [ + "tau", + "twitch", + "typescript" + ], + "author": "cgsdev0", + "license": "MIT", + "bugs": { + "url": "https://github.com/Team-TAU/tau/issues" + }, + "homepage": "https://github.com/Team-TAU/tau#readme", + "devDependencies": { + "prettier": "^2.8.4", + "quicktype": "^23.0.11" + } +}