From 579ef33e79c481432020ff7043366b30168c5664 Mon Sep 17 00:00:00 2001 From: Paul Cothenet Date: Wed, 1 Sep 2021 12:52:23 -0700 Subject: [PATCH] Add deployment notifications --- .github/workflows/publish.yml | 39 ++++++++++++++++++++++++++++++++--- .gitignore | 5 +++-- package-lock.json | 4 ++-- package.json | 2 +- src/ApiClient.js | 2 +- 5 files changed, 43 insertions(+), 9 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 2691b4e..6f05263 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -3,25 +3,58 @@ name: Publish on: release: types: [created] - jobs: build: runs-on: ubuntu-latest + env: + TARGET_URL: https://www.npmjs.com/package/@patch-technology/patch + steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 + + - uses: chrnorm/deployment-action@releases/v1 + name: Create GitHub deployment + id: deployment + with: + token: "${{ github.token }}" + target_url: ${{ env.TARGET_URL }} + environment: production + - uses: actions/setup-node@v2 with: - node-version: 12 + node-version: 14 registry-url: https://registry.npmjs.org/ + - name: Install dependencies run: npm install + - name: Build package run: npm run build + - name: Run tests env: SANDBOX_API_KEY: ${{ secrets.SANDBOX_API_KEY }} run: npm test + - name: Publish package run: npm publish --access public env: NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} + + - name: Update deployment status (success) + if: success() + uses: chrnorm/deployment-status@releases/v1 + with: + token: "${{ github.token }}" + target_url: ${{ env.TARGET_URL }} + state: "success" + deployment_id: ${{ steps.deployment.outputs.deployment_id }} + + - name: Update deployment status (failure) + if: failure() + uses: chrnorm/deployment-status@releases/v1 + with: + token: "${{ github.token }}" + target_url: ${{ env.TARGET_URL }} + state: "failure" + deployment_id: ${{ steps.deployment.outputs.deployment_id }} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 249b33e..b2fb4f7 100644 --- a/.gitignore +++ b/.gitignore @@ -32,9 +32,10 @@ node_modules # Optional REPL history .node_repl_history -# OpenAPI Code gen artifacts -.openapi-generator/ +# Ignore openapi-generator artifacts .openapi-generator-ignore +/.openapi-generator/ +git_push.sh # OS artifacts .DS_Store diff --git a/package-lock.json b/package-lock.json index 515b533..89c08ba 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@patch-technology/patch", - "version": "1.10.1", + "version": "1.10.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@patch-technology/patch", - "version": "1.10.1", + "version": "1.10.2", "license": "MIT", "dependencies": { "query-string": "^7.0.1", diff --git a/package.json b/package.json index 163319c..7425edb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@patch-technology/patch", - "version": "1.10.1", + "version": "1.10.2", "description": "Node.js wrapper for the Patch API", "license": "MIT", "repository": { diff --git a/src/ApiClient.js b/src/ApiClient.js index 54279bd..ae45994 100644 --- a/src/ApiClient.js +++ b/src/ApiClient.js @@ -16,7 +16,7 @@ class ApiClient { }; this.defaultHeaders = { - 'User-Agent': 'patch-node/1.10.1' + 'User-Agent': 'patch-node/1.10.2' }; /**