-
Notifications
You must be signed in to change notification settings - Fork 28
54 lines (52 loc) · 1.55 KB
/
ci.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
name: CI
on:
pull_request:
types: [opened, synchronize, reopened, closed]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Check formatting
run: npm run format-check
- name: Build
run: npm run build --if-present
- name: Package artifacts
run: npm run package
- name: Run Tests
run: npm run test-verbose
env:
CI: true
- name: Prepare post-merge steps
if: >
github.event.action == 'closed' &&
github.event.pull_request.merged
run: git checkout ${{ github.event.pull_request.base.ref }}
- name: Publish artifacts
if: >
github.event.action == 'closed' &&
github.event.pull_request.merged
uses: EndBug/add-and-commit@v9
with:
commit: --signoff
default_author: user_info
fetch: false
message: 'dist: build new artifacts'
push: true
- name: Create and move next-preview tag
if: >
github.event.action == 'closed' &&
github.event.pull_request.merged && (
github.event.pull_request.base.ref == 'main' ||
startsWith(github.event.pull_request.base.ref, 'release')
)
run: |
git tag v2.next-preview --force
git push origin v2.next-preview --force