|
|
name: CI |
|
|
|
|
|
on: |
|
|
push: |
|
|
branches: [master, alpha] |
|
|
pull_request: |
|
|
branches: [master, alpha] |
|
|
|
|
|
jobs: |
|
|
test: |
|
|
runs-on: ubuntu-latest |
|
|
|
|
|
strategy: |
|
|
|
|
|
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 |
|
|
|
|
|
- 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: |
|
|
|
|
|
|
|
|
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 }} |
|
|
|