|
7 | 7 | branches: [main]
|
8 | 8 |
|
9 | 9 | jobs:
|
10 |
| - test: |
| 10 | + main: |
11 | 11 | # ignore all-contributors PRs
|
12 | 12 | if: ${{ !contains(github.head_ref, 'all-contributors') }}
|
13 |
| - |
14 |
| - runs-on: ubuntu-latest |
15 |
| - |
16 | 13 | strategy:
|
17 | 14 | matrix:
|
18 | 15 | node: [10.x, 12.x]
|
19 |
| - |
| 16 | + runs-on: ubuntu-latest |
20 | 17 | steps:
|
21 |
| - - name: Cancel previous runs |
22 |
| - |
23 |
| - with: |
24 |
| - access_token: ${{ secrets.GITHUB_TOKEN }} |
| 18 | + - name: 🛑 Cancel Previous Runs |
| 19 | + |
| 20 | + |
| 21 | + - name: ⬇️ Checkout repo |
| 22 | + uses: actions/checkout@v2 |
| 23 | + |
| 24 | + - name: ⎔ Setup node |
| 25 | + uses: actions/setup-node@v2 |
| 26 | + with: |
| 27 | + node-version: ${{ matrix.node }} |
25 | 28 |
|
26 |
| - - uses: actions/checkout@v2 |
| 29 | + - name: 📥 Download deps |
| 30 | + uses: bahmutov/npm-install@v1 |
| 31 | + with: |
| 32 | + useLockFile: false |
27 | 33 |
|
28 |
| - - name: Setup nodejs |
29 |
| - uses: actions/setup-node@v2-beta |
30 |
| - with: |
31 |
| - node-version: ${{ matrix.node }} |
32 |
| - - name: Install deps & validate |
33 |
| - run: npm run setup |
| 34 | + - name: ▶️ Run validate script |
| 35 | + run: npm run validate |
| 36 | + |
| 37 | + - name: ⬆️ Upload coverage report |
| 38 | + uses: codecov/codecov-action@v1 |
34 | 39 |
|
35 | 40 | release:
|
| 41 | + needs: main |
36 | 42 | runs-on: ubuntu-latest
|
37 | 43 | if:
|
38 | 44 | ${{ github.repository == 'testing-library/svelte-testing-library' &&
|
39 |
| - github.ref == 'refs/heads/main' && github.event_name == 'push' }} |
40 |
| - |
| 45 | + contains('refs/heads/main,refs/heads/beta,refs/heads/next,refs/heads/alpha', |
| 46 | + github.ref) && github.event_name == 'push' }} |
41 | 47 | steps:
|
42 |
| - - name: Cancel previous runs |
43 |
| - |
44 |
| - with: |
45 |
| - access_token: ${{ secrets.GITHUB_TOKEN }} |
46 |
| - |
47 |
| - - uses: actions/checkout@v2 |
48 |
| - |
49 |
| - - name: Setup nodejs |
50 |
| - uses: actions/setup-node@v2-beta |
51 |
| - with: |
52 |
| - node-version: 14 |
53 |
| - - name: Install deps |
54 |
| - run: npm install |
55 |
| - - name: Build proj |
56 |
| - run: npm run build |
57 |
| - - name: Update tests, coverage, and release |
58 |
| - run: npm run test:update && npx codecov && npx semantic-release |
59 |
| - env: |
60 |
| - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |
61 |
| - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 48 | + - name: 🛑 Cancel Previous Runs |
| 49 | + |
| 50 | + |
| 51 | + - name: ⬇️ Checkout repo |
| 52 | + uses: actions/checkout@v2 |
| 53 | + |
| 54 | + - name: ⎔ Setup node |
| 55 | + uses: actions/setup-node@v2 |
| 56 | + with: |
| 57 | + node-version: 14 |
| 58 | + |
| 59 | + - name: 📥 Download deps |
| 60 | + uses: bahmutov/npm-install@v1 |
| 61 | + with: |
| 62 | + useLockFile: false |
| 63 | + |
| 64 | + - name: 🏗 Run build script |
| 65 | + run: npm run build |
| 66 | + |
| 67 | + - name: 🚀 Release |
| 68 | + uses: cycjimmy/semantic-release-action@v2 |
| 69 | + with: |
| 70 | + semantic_version: 17 |
| 71 | + branches: | |
| 72 | + [ |
| 73 | + '+([0-9])?(.{+([0-9]),x}).x', |
| 74 | + 'main', |
| 75 | + 'next', |
| 76 | + 'next-major', |
| 77 | + {name: 'beta', prerelease: true}, |
| 78 | + {name: 'alpha', prerelease: true} |
| 79 | + ] |
| 80 | + env: |
| 81 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 82 | + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |
0 commit comments