-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (72 loc) · 2.2 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
name: CI
on:
push:
branches: [master, alpha]
pull_request:
branches: [master, alpha]
jobs:
test:
runs-on: ubuntu-latest
strategy:
# Otherwise how would we know if a specific React version caused the failure?
fail-fast: false
matrix:
REACT_DIST: [16, 17, 18]
steps:
- uses: actions/checkout@v2
- name: Use Node.js 14
uses: actions/setup-node@v2
with:
node-version: 14
cache: 'npm'
- run: yarn
- run: yarn add react@${{ matrix.REACT_DIST }} react-dom@${{ matrix.REACT_DIST }}
- run: yarn add @testing-library/react@12
if: matrix.REACT_DIST == '17' || matrix.REACT_DIST == '16'
- run: yarn --cwd www
# Test whether the web page can be built successfully or not
- run: yarn --cwd www build
- run: yarn test
- name: Dry release
uses: cycjimmy/semantic-release-action@v2
with:
dry_run: true
semantic_version: 17
branches: |
[
'master',
{name: 'alpha', prerelease: true}
]
env:
# These are not available on forks but we need them on actual runs to verify everything is set up.
# Otherwise we might fail in the middle of a release
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
release:
needs: test
runs-on: ubuntu-latest
if: ${{ github.repository == 'reactjs/react-transition-group' &&
contains('refs/heads/master,refs/heads/alpha',
github.ref) && github.event_name == 'push' }}
steps:
- uses: styfle/cancel-workflow-action@0.9.0
- uses: actions/checkout@v2
- name: Use Node.js 14
uses: actions/setup-node@v2
with:
node-version: 14
cache: 'npm'
- run: yarn
- run: yarn build
- name: Release
uses: cycjimmy/semantic-release-action@v2
with:
semantic_version: 17
branches: |
[
'master',
{name: 'alpha', prerelease: true}
]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}