Skip to content

Add deployment notifications #40

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 36 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion src/ApiClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class ApiClient {
};

this.defaultHeaders = {
'User-Agent': 'patch-node/1.10.1'
'User-Agent': 'patch-node/1.10.2'
};

/**
Expand Down