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