-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (81 loc) · 1.95 KB
/
build.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Build
on:
push:
branches: [ "main" ]
workflow_dispatch:
inputs:
release:
type: choice
required: true
description: Create a release
default: 'no'
options:
- 'no'
- 'yes'
jobs:
build-node18:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v4
with:
node-version: '18.x'
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Install, build, check and test
run: |
npm install
npm run build
npm run test
build:
runs-on: ubuntu-latest
needs: build-node18
steps:
- uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Install, build, check and test
run: |
npm install
npm run build
cd docs/samples
npm install
cd ../..
npm run build-web
npm run test
npm pack
echo RELEASE_TAG=v`node scripts/show-version.mjs` >> "$GITHUB_ENV"
sudo apt-get install zip
cd dist/browser
zip -r ../../con-reg-exp-browser.zip *
- name: Release
uses: softprops/action-gh-release@v1
if: "${{ github.event.inputs.release == 'yes' }}"
with:
files: |
./con-reg-exp-*.tgz
./con-reg-exp-*.zip
draft: false
tag_name: ${{ env.RELEASE_TAG }}
fail_on_unmatched_files: true
generate_release_notes: true
- name: NPM Publish
if: "${{ github.event.inputs.release == 'yes' }}"
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
npm publish
- name: Prepare an Artifact
run: |
cd web
zip -r ../web.zip *
- name: Upload an Artifact
uses: actions/upload-artifact@v4
with:
name: result
path: |
./*.zip
./*.gz
./*.tgz