Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release TS SDK 2.0 #8

Merged
merged 1 commit into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Publish to npmjs.com

on:
release:
types: [published]

jobs:
build-and-publish:
name: Build and publish to npmjs.com
runs-on: ubuntu-latest
steps:
- name: Setup Node.js 20
uses: actions/setup-node@v3
with:
node-version: 20
- name: Checkout source code
uses: actions/checkout@v3
- name: Install pnpm
run: npm install -g pnpm@8.7.4
# doesn't work with Node 20
# - name: Install pnpm
# uses: pnpm/action-setup@v2
# with:
# version: 8.7.4
# run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install --frozen-lockfile false
- name: Build code
run: npm run build
- run: |
npm config set //registry.npmjs.org/:_authToken=$NPM_AUTH_TOKEN
npm publish
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
54 changes: 54 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Test
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]

jobs:
test:
name: Node.js ${{ matrix['node-version'] }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
node-version:
- "20"
# - "18"
# - "16"
os:
- ubuntu-latest
# - macos-latest
# - windows-latest
steps:
- name: Setup Node.js ${{ matrix['node-version'] }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix['node-version'] }}
- name: Checkout source code
uses: actions/checkout@v3
- name: Install pnpm
run: npm install -g pnpm@8.7.4
# doesn't work with Node 20
# - name: Install pnpm
# uses: pnpm/action-setup@v2
# with:
# version: 8.7.4
# run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ matrix.os }}${{ matrix['node-version'] }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ matrix.os }}${{ matrix['node-version'] }}-pnpm-store-
- name: Install dependencies
run: pnpm install --frozen-lockfile false
- name: Build code
run: npm run build
- name: Run tests
run: npm test
86 changes: 14 additions & 72 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,80 +1,22 @@

# Created by https://www.gitignore.io/api/node

### Node ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
# Coverage reports
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
# API keys and secrets
.env

# parcel-bundler cache (https://parceljs.org/)
.cache

# next.js build output
.next

# nuxt.js build output
.nuxt
# Dependency directory
node_modules

# vuepress build output
.vuepress/dist
# Editors
.idea
*.iml

# Serverless directories
.serverless
# OS metadata
.DS_Store
Thumbs.db

# Ignore built ts files
dist/**/*

# End of https://www.gitignore.io/api/node
# Ignore Jest directory
.jest
1 change: 1 addition & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
semi: true
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 AssemblyAI

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading