diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml new file mode 100644 index 00000000000..c6e8d53adf1 --- /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_ACCESS_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}} 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",