-
Notifications
You must be signed in to change notification settings - Fork 1
61 lines (48 loc) · 1.44 KB
/
merge.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
56
57
58
59
60
61
name: Send built code in production when a merge commit is created
on:
push:
tags:
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10
workflow_dispatch:
jobs:
build:
name: Release & Publish
runs-on: ubuntu-latest
environment: production
strategy:
matrix:
node-version: [18.x]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: yarn --frozen-lockfile
- name: Run clean
run: yarn clean
- name: Run build lib and types
run: yarn build:lib
- name: Copy LICENSE
run: cp LICENSE build/LICENSE
- name: Copy README
run: cp README.md build/README.md
- name: Copy package.json
run: cp package.json build/package.json
- name: Publish package to NPM
run: npm publish ./build
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false