Skip to content

Commit 02bd014

Browse files
authored
Merge pull request #77 from ExtendScript/ci/github-actions
ci(actions): Setup actions with tests
2 parents 5f6b5c0 + 87fd449 commit 02bd014

File tree

4 files changed

+31197
-2917
lines changed

4 files changed

+31197
-2917
lines changed

.github/workflows/test.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# basic nodejs github action to run npm test and build
2+
3+
name: Node.js CI
4+
5+
on:
6+
push:
7+
branches: [ master ]
8+
pull_request:
9+
branches: [ master ]
10+
11+
jobs:
12+
build:
13+
14+
runs-on: ubuntu-latest
15+
16+
strategy:
17+
matrix:
18+
node-version: [ 14.x, 16.x, 18.x]
19+
20+
steps:
21+
- uses: actions/checkout@v2
22+
- name: Use Node.js ${{ matrix.node-version }}
23+
uses: actions/setup-node@v1
24+
with:
25+
node-version: ${{ matrix.node-version }}
26+
- run: npm ci
27+
- run: npm test
28+
- run: npm run build --if-present
29+
- run: npm run lint --if-present
30+
31+
release:
32+
release:
33+
name: semantic-release
34+
needs: [build]
35+
runs-on: ubuntu-latest
36+
outputs:
37+
new-release-published: ${{ steps.semantic-release.outputs.new_release_published }}
38+
new-release-version: ${{ steps.semantic-release.outputs.new_release_version }}
39+
steps:
40+
- uses: actions/checkout@v3
41+
with:
42+
persist-credentials: false
43+
- uses: actions/setup-node@v3
44+
with:
45+
node-version-file: '.nvmrc'
46+
- run: npm ci
47+
- id: semantic-release
48+
run: npx semantic-release
49+
env:
50+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
51+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)