Skip to content
This repository was archived by the owner on Jan 2, 2023. It is now read-only.

Commit a4a9baf

Browse files
Bassem DghaidiBassem Dghaidi
authored andcommitted
Add build and publish workflows
1 parent 717b231 commit a4a9baf

File tree

2 files changed

+33
-5
lines changed

2 files changed

+33
-5
lines changed
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
22
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
33

4-
name: Node.js CI
4+
name: Build & Test
55

66
on:
77
push:
@@ -11,13 +11,11 @@ on:
1111

1212
jobs:
1313
build:
14-
14+
name: 'Build & Test'
1515
runs-on: ubuntu-latest
16-
1716
strategy:
1817
matrix:
1918
node-version: [10.x, 12.x]
20-
2119
steps:
2220
- uses: actions/checkout@v2
2321
- name: Use Node.js ${{ matrix.node-version }}
@@ -26,4 +24,4 @@ jobs:
2624
node-version: ${{ matrix.node-version }}
2725
- run: npm ci
2826
- run: npm run build --if-present
29-
- run: npm test
27+
- run: npm test

.github/workflows/publish.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: npm-publish
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
npm-publish:
10+
name: npm-publish
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
node-version: [10.x, 12.x]
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@master
18+
- name: Use Node.js ${{ matrix.node-version }}
19+
uses: actions/setup-node@v1
20+
with:
21+
node-version: ${{ matrix.node-version }}
22+
- name: Publish if version has been updated
23+
uses: pascalgn/npm-publish-action@4f4bf159e299f65d21cd1cbd96fc5d53228036df
24+
with: # All of theses inputs are optional
25+
tag_name: "%s"
26+
tag_message: "%s"
27+
commit_pattern: "^Release (\\S+)"
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Leave this as is, it's automatically generated
30+
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} # You need to set this in your repo settings

0 commit comments

Comments
 (0)