Skip to content

Commit f5bfc10

Browse files
authored
chore: Move from TavisCI to GitHub Actions (#783)
* format code * Create GH Actions workflow based on previous Travis setup * Only from master Was just temporarily enable for other branches for testing * Remove obsolete Travis config * Base semantic-release action off of dom-testing-library https://github.com/testing-library/dom-testing-library/blob/74c63b7be5c7d628e3a415396bc6f3d83a90c28e/.github/workflows/validate.yml#L57-L99 * Complete full matrix * Remove unnecessary secrets usage from dry run * We need secrets being set See https://semantic-release.gitbook.io/semantic-release/usage/configuration#dryrun: "Note: The Dry-run mode verifies the repository push permission, even though nothing will be pushed. The verification is done to help user to figure out potential configuration issues."
1 parent 6877a6d commit f5bfc10

File tree

2 files changed

+72
-21
lines changed

2 files changed

+72
-21
lines changed

.github/workflows/ci.yml

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
# Otherwise how would we know if a specific React version caused the failure?
15+
fail-fast: false
16+
matrix:
17+
REACT_DIST: [16, 17]
18+
19+
steps:
20+
- uses: actions/checkout@v2
21+
- name: Use Node.js 14
22+
uses: actions/setup-node@v2
23+
with:
24+
node-version: 14
25+
cache: 'npm'
26+
- run: yarn
27+
- run: yarn add react@${{ matrix.REACT_DIST }} react-dom@${{ matrix.REACT_DIST }}
28+
- run: yarn --cwd www
29+
- run: yarn test
30+
- name: Dry release
31+
uses: cycjimmy/semantic-release-action@v2
32+
with:
33+
dry_run: true
34+
semantic_version: 17
35+
branches: |
36+
[
37+
'master',
38+
{name: 'alpha', prerelease: true}
39+
]
40+
env:
41+
# These are not available on forks but we need them on actual runs to verify everything is set up.
42+
# Otherwise we might fail in the middle of a release
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
45+
46+
release:
47+
needs: test
48+
runs-on: ubuntu-latest
49+
if: ${{ github.repository == 'reactjs/react-transition-group' &&
50+
contains('refs/heads/master,refs/heads/alpha',
51+
github.ref) && github.event_name == 'push' }}
52+
steps:
53+
- uses: styfle/[email protected]
54+
- uses: actions/checkout@v2
55+
- name: Use Node.js 14
56+
uses: actions/setup-node@v2
57+
with:
58+
node-version: 14
59+
cache: 'npm'
60+
- run: yarn
61+
- name: Release
62+
uses: cycjimmy/semantic-release-action@v2
63+
with:
64+
semantic_version: 17
65+
branches: |
66+
[
67+
'master',
68+
{name: 'alpha', prerelease: true}
69+
]
70+
env:
71+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
72+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.travis.yml

-21
This file was deleted.

0 commit comments

Comments
 (0)