-
Notifications
You must be signed in to change notification settings - Fork 12
55 lines (55 loc) · 1.7 KB
/
github-actions-paxful.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Paxful Javascript SDK
on:
push:
branches:
- master
tags:
- "v*"
pull_request:
branches: [ master ]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 12.x
uses: actions/setup-node@v2
with:
node-version: 12.x
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm run build --if-present
- run: npm test
env:
PAXFUL_OAUTH_HOST: ${{ secrets.PAXFUL_OAUTH_HOST }}
PAXFUL_DATA_HOST: ${{ secrets.PAXFUL_DATA_HOST }}
PAXFUL_CLIENT_ID: ${{ secrets.PAXFUL_CLIENT_ID }}
PAXFUL_CLIENT_SECRET: ${{ secrets.PAXFUL_CLIENT_SECRET }}
SELLER_CLIENT_ID: ${{ secrets.SELLER_CLIENT_ID }}
SELLER_CLIENT_SECRET: ${{ secrets.SELLER_CLIENT_SECRET }}
BUYER_CLIENT_ID: ${{ secrets.BUYER_CLIENT_ID }}
BUYER_CLIENT_SECRET: ${{ secrets.BUYER_CLIENT_SECRET }}
- run: echo "🎉 Tests completed."
deploy:
name: Publish
if: ${{ startsWith(github.ref, 'refs/tags/') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 12.x
uses: actions/setup-node@v2
with:
node-version: 12.x
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm run build --if-present
- name: Set output
id: vars
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/v}
- run: npm version $RELEASE_VERSION --no-git-tag-version
env:
RELEASE_VERSION: ${{ steps.vars.outputs.tag }}
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}