Skip to content

Commit 6fbb1dc

Browse files
committed
add actions
1 parent 43a10d9 commit 6fbb1dc

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed

.github/workflows/npm-publish.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Publish Package
2+
3+
on:
4+
pull_request:
5+
types: [closed]
6+
branches:
7+
- main
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-node@v4
15+
with:
16+
node-version: 20
17+
- run: npm ci
18+
- run: npm run test
19+
- run: npm run lint
20+
21+
publish-npm:
22+
needs: build
23+
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'publish')
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@v4
27+
- uses: actions/setup-node@v4
28+
with:
29+
node-version: 20
30+
registry-url: https://registry.npmjs.org/
31+
- run: npm ci
32+
- run: npm run build
33+
- run: npm publish
34+
env:
35+
NODE_AUTH_TOKEN: ${{secrets.twilio_alpha_npm_token}}

.github/workflows/pr-validator.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: PR Validator
2+
3+
on:
4+
push:
5+
branches: ['main']
6+
pull_request:
7+
branches: ['main']
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: actions/setup-node@v4
16+
with:
17+
node-version: 20
18+
cache: 'npm'
19+
- run: npm ci
20+
- run: npm run lint
21+
- run: npm run build

0 commit comments

Comments
 (0)