Skip to content

Commit

Permalink
Merge branch 'tsup'
Browse files Browse the repository at this point in the history
  • Loading branch information
fostertheweb committed Dec 11, 2023
2 parents 60169f5 + 99b9055 commit 9d7441b
Show file tree
Hide file tree
Showing 9 changed files with 922 additions and 103 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: CI
on:
push:
branches:
- "**"

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v3
with:
node-version: 20.x
cache: "pnpm"

- run: pnpm install --frozen-lockfile
- run: pnpm run lint && pnpm run build
37 changes: 0 additions & 37 deletions .github/workflows/npm-publish.yml

This file was deleted.

36 changes: 36 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Publish
on:
workflow_run:
workflows: [CI]
branches: [main]
types: [completed]

concurrency: ${{ github.workflow }}-${{ github.ref }}

permissions:
contents: write
pull-requests: write

jobs:
publish:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v3
with:
node-version: 20.x
cache: "pnpm"

- run: pnpm install --frozen-lockfile
- name: Create Release Pull Request or Publish
id: changesets
uses: changesets/action@v1
with:
publish: pnpm run release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
28 changes: 10 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,18 @@
{
"name": "@fostertheweb/spotify-web-sdk",
"version": "1.2.1",
"description": "A typescript SDK for the Spotify Web API",
"main": "dist/cjs/index.js",
"module": "dist/mjs/index.js",
"types": "dist/mjs/index.d.ts",
"description": "A TypeScript SDK for the Spotify Web API",
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"scripts": {
"start": "npx vite serve",
"test": "vitest run",
"ci": "npm run build",
"build": "npm run build:cjs && npm run build:mjs",
"build:mjs": "tsc --project tsconfig.mjs.json && cp res/package.mjs.json dist/mjs/package.json",
"build:cjs": "tsc --project tsconfig.cjs.json && cp res/package.cjs.json dist/cjs/package.json",
"build:win": "npm run build:cjs-win && npm run build:mjs-win",
"build:mjs-win": "tsc --project tsconfig.mjs.json && xcopy .\\res\\package.mjs.json .\\dist\\mjs\\package.json /-I /Y",
"build:cjs-win": "tsc --project tsconfig.cjs.json && xcopy .\\res\\package.cjs.json .\\dist\\cjs\\package.json /-I /Y"
},
"exports": {
"import": "./dist/mjs/index.js",
"require": "./dist/cjs/index.js"
"build": "tsup src/index.ts --format cjs,esm --dts",
"release": "pnpm run build && changeset publish",
"lint": "tsc"
},
"repository": {
"type": "git",
"url": "https://github.com/fostertheweb/spotify-web-api-ts-sdk"
"url": "https://github.com/fostertheweb/spotify-web-sdk"
},
"author": "Spotify",
"license": "Apache",
Expand All @@ -33,6 +23,8 @@
"dotenv": "^16.3.1",
"jsdom": "^22.1.0",
"playwright": "^1.35.1",
"tsup": "^8.0.1",
"typedoc": "^0.25.4",
"typescript": "^5.1.6",
"uuid": "^9.0.0",
"vite": "^4.3.9",
Expand Down
Loading

0 comments on commit 9d7441b

Please sign in to comment.