From f7c6c8926be963fa9979d17eb0932e2278389168 Mon Sep 17 00:00:00 2001 From: Andrew Wylde Date: Tue, 16 Nov 2021 15:18:44 -0800 Subject: [PATCH 1/3] Create npm-publish.yml --- .github/workflows/npm-publish.yml | 49 +++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/npm-publish.yml diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml new file mode 100644 index 00000000000..4038dead3c1 --- /dev/null +++ b/.github/workflows/npm-publish.yml @@ -0,0 +1,49 @@ +# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created +# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages + +name: Node.js Package + +on: + release: + types: [created] +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: 12 + - run: npm ci + - run: npm test + + publish-npm: + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: 12 + registry-url: https://registry.npmjs.org/ + - run: npm ci + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{secrets.npm_token}} + + publish-gpr: + needs: build + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: 12 + registry-url: https://npm.pkg.github.com/ + - run: npm ci + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} From af8d5511105622aa8897d70434bd7306dd7672a4 Mon Sep 17 00:00:00 2001 From: Andrew Wylde Date: Tue, 16 Nov 2021 15:21:54 -0800 Subject: [PATCH 2/3] scope package.json to @kong org --- package.json | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index bcda9f1c3de..32ff5228701 100644 --- a/package.json +++ b/package.json @@ -1,18 +1,9 @@ { - "name": "swagger-ui", + "name": "@kong/swagger-ui", "version": "3.26.0", "main": "dist/swagger-ui.js", - "homepage": "https://github.com/swagger-api/swagger-ui", - "repository": "git@github.com:swagger-api/swagger-ui.git", - "contributors": [ - "(in alphabetical order)", - "Anna Bodnia ", - "Buu Nguyen ", - "Josh Ponelat ", - "Kyle Shockey ", - "Robert Barnwell ", - "Sahar Jafari " - ], + "homepage": "https://github.com/Kong/swagger-ui", + "repository": "git@github.com:Kong/swagger-ui.git", "license": "Apache-2.0", "scripts": { "automated-release": "release-it -VV --config ./release/.release-it.json", From 678f7a9fc8bbaa342bb2f9daa90eb5f5836f28a7 Mon Sep 17 00:00:00 2001 From: Andrew Wylde Date: Tue, 16 Nov 2021 15:46:37 -0800 Subject: [PATCH 3/3] update token name --- .github/workflows/npm-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 4038dead3c1..c6e8d53adf1 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -29,7 +29,7 @@ jobs: - run: npm ci - run: npm publish env: - NODE_AUTH_TOKEN: ${{secrets.npm_token}} + NODE_AUTH_TOKEN: ${{secrets.NPM_ACCESS_TOKEN}} publish-gpr: needs: build