diff --git a/.github/workflows/publish-node-client.yml b/.github/workflows/publish-node-client.yml new file mode 100644 index 00000000..9b5b095a --- /dev/null +++ b/.github/workflows/publish-node-client.yml @@ -0,0 +1,33 @@ +name: Publish node REST client package +on: + release: + types: [published] +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Setup node + uses: actions/setup-node@v3 + with: + node-version: '18.x' + registry-url: 'https://npm.pkg.github.com' + scope: '@ministryofjustice' + - name: Install dependencies + run: | + cd clients/node + npm clean-install --no-audit + - name: Run tests + run: | + cd clients/node + npm test + - name: Publish package + run: | + cd clients/node + npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/clients/node/package.json b/clients/node/package.json index edaeac13..7f81cfdf 100644 --- a/clients/node/package.json +++ b/clients/node/package.json @@ -9,7 +9,10 @@ "url": "https://mojdigital.blog.gov.uk/" }, "homepage": "https://github.com/ministryofjustice/hmpps-non-associations-api", - "repository": "git@github.com:ministryofjustice/hmpps-non-associations-api.git", + "repository": { + "type": "git", + "url": "https://github.com/ministryofjustice/hmpps-non-associations-api.git" + }, "license": "MIT", "main": "dist/index.js", "types": "dist/index.d.ts",