From 7eb8f72581b07b557415ddf2db340fe435323533 Mon Sep 17 00:00:00 2001 From: Bill Thornton Date: Thu, 15 Sep 2022 00:32:50 -0400 Subject: [PATCH] Add stable SDK publish workflow --- .github/workflows/sdk-publish.yaml | 28 ++++++++++++++++++++++++++++ .npmrc | 1 + package.json | 3 --- 3 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/sdk-publish.yaml diff --git a/.github/workflows/sdk-publish.yaml b/.github/workflows/sdk-publish.yaml new file mode 100644 index 000000000..bd944854d --- /dev/null +++ b/.github/workflows/sdk-publish.yaml @@ -0,0 +1,28 @@ +name: SDK Publish + +on: + release: + types: [published] + +jobs: + publish: + runs-on: ubuntu-latest + if: ${{ github.repository == 'jellyfin/jellyfin-sdk-typescript' }} + steps: + - name: Check out Git repository + uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3 + + - name: Set up Node.js + uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # tag=v3 + with: + node-version: 16 + check-latest: true + cache: npm + + - name: Install Node.js dependencies + run: npm ci --no-audit + + - name: Publish the SDK to npm + run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.npmrc b/.npmrc index 59368a9bf..daf730519 100644 --- a/.npmrc +++ b/.npmrc @@ -1,2 +1,3 @@ +access=public lockfile-version=3 save-exact=true diff --git a/package.json b/package.json index e00d37b72..8ca101739 100644 --- a/package.json +++ b/package.json @@ -12,9 +12,6 @@ "type": "git", "url": "https://github.com/jellyfin/jellyfin-sdk-typescript.git" }, - "publishConfig": { - "access": "public" - }, "scripts": { "build": "npm run build:generated-client && npm run build:sdk", "build:generated-client": "openapi-generator-cli generate",