-
Notifications
You must be signed in to change notification settings - Fork 22
55 lines (46 loc) · 1.43 KB
/
npm-release.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: NPM Release
on:
workflow_dispatch:
inputs:
versionType:
description: 'Version type (major, minor, patch)'
required: true
default: 'patch'
branches:
- master
jobs:
npm-release:
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0 # fetch all history so that we can determine the version bump
- name: Configure Git
run: |
git config --global user.name "${{ secrets.GIT_USER_NAME }}"
git config --global user.email "${{ secrets.GIT_USER_EMAIL }}"
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '16'
registry-url: 'https://registry.npmjs.org/'
- name: Install dependencies
run: npm install
- name: Run Tests
run: |
npx playwright install --with-deps chromium
npm test
- name: Bump version
run: npm version ${{ github.event.inputs.versionType }} -m "Upgrade to %s"
- name: Publish to npm
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Push changes and tags
run: |
git config user.name "${{ secrets.GIT_USER_NAME }}"
git config user.email "${{ secrets.GIT_USER_EMAIL }}"
git push
git push --tags