Skip to content

Commit e801411

Browse files
authored
Create publish.yml
1 parent 3bab25c commit e801411

1 file changed

Lines changed: 52 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3+
4+
name: Node.js CI
5+
6+
on:
7+
push:
8+
branches: [ main ]
9+
pull_request:
10+
branches: '*'
11+
workflow_dispatch:
12+
inputs:
13+
name:
14+
description: 'Manually running workflow...'
15+
required: true
16+
default: 'To check'
17+
18+
jobs:
19+
build:
20+
21+
runs-on: ubuntu-latest
22+
23+
strategy:
24+
matrix:
25+
node-version: [12.x, 14.x, 16.x]
26+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
27+
28+
steps:
29+
- uses: actions/checkout@v2
30+
- name: Use Node.js ${{ matrix.node-version }}
31+
uses: actions/setup-node@v2
32+
with:
33+
node-version: ${{ matrix.node-version }}
34+
- run: npm ci
35+
- run: npm run build --if-present
36+
# - run: npm test
37+
38+
publish:
39+
if: ${{ github.ref == 'refs/heads/main' }}
40+
runs-on: ubuntu-latest
41+
needs: [build]
42+
steps:
43+
- uses: actions/checkout@v2
44+
- name: Use Node.js ${{ matrix.node-version }}
45+
uses: actions/setup-node@v2
46+
with:
47+
node-version: ${{ matrix.node-version }}
48+
- run: npm ci
49+
- run: npm run semantic-release
50+
env:
51+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
52+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)