-
-
Notifications
You must be signed in to change notification settings - Fork 4
111 lines (96 loc) · 2.8 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
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: CI
on:
push:
branches: [main]
paths:
- 'packages/**'
tags:
- '[0-9]+.[0-9]+.[0-9]+*'
pull_request:
branches: [main]
paths:
- 'packages/**'
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: pnpm/[email protected]
with:
version: 6.24.2
- uses: actions/setup-node@v2
with:
node-version: '16'
cache: 'pnpm'
- name: Install dependencies
run: pnpm i --frozen-lockfile
- name: Build
run: pnpm build-all
- uses: actions/upload-artifact@v2
with:
name: build-artifacts
path: |
packages/*/cjs
packages/*/esm
packages/*/lib
packages/*/dts
test:
name: Test
runs-on: ubuntu-latest
# strategy:
# fail-fast: false
# matrix:
# # See supported Node.js release schedule at https://nodejs.org/en/about/releases/
# node-version: [12.x, 14.x, 16.x, 17.x]
steps:
- uses: actions/checkout@v2
- uses: pnpm/[email protected]
with:
version: 6.24.2
- uses: actions/setup-node@v2
with:
node-version: '16'
cache: 'pnpm'
- name: Install dependencies
run: pnpm i --frozen-lockfile
- run: pnpm test -- --verbose
publish:
name: 'Publish to NPM'
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.repository == 'brendonovich/sceneify'
needs: [build, test]
steps:
- uses: actions/checkout@v2
- uses: pnpm/[email protected]
with:
version: 6.24.2
- uses: actions/setup-node@v2
with:
node-version: '16'
cache: 'pnpm'
- name: Download build
uses: actions/download-artifact@v2
with:
name: build-artifacts
path: packages
- name: Configure main version
if: github.ref == 'refs/heads/main'
run: pnpm set-package-versions
env:
RELEASE_COMMIT_SHA: ${{ github.sha }}
- name: Publish main to npm
if: github.ref == 'refs/heads/main'
run: pnpm publish -r ${TAG} --no-git-checks --filter "@sceneify/*" --access public
env:
TAG: ${{ (github.ref == 'refs/heads/main' && '--tag=main') || '' }}
NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Configure release version
if: github.ref_type == 'tag'
run: pnpm set-package-versions
- name: Publish release to npm
if: github.ref_type == 'tag'
run: pnpm publish -r ${TAG} --no-git-checks --filter "@sceneify/*" --access public
env:
TAG: ${{ (contains(github.ref_name, '-beta.') && '--tag=beta') || ''}}
NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}