|
1 | 1 | name: Publish
|
2 | 2 |
|
3 |
| -on: [push, pull_request] |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - master |
| 7 | + pull_request: |
4 | 8 |
|
5 | 9 | jobs:
|
6 | 10 | build:
|
7 |
| - |
8 | 11 | runs-on: ubuntu-latest
|
9 | 12 |
|
10 | 13 | steps:
|
11 |
| - - uses: actions/checkout@v2 |
12 |
| - |
13 |
| - - uses: actions/setup-node@v1 |
14 |
| - with: |
15 |
| - node-version: '15.x' |
16 |
| - registry-url: 'https://registry.npmjs.org' |
17 |
| - |
18 |
| - - id: yarn-cache-dir-path |
19 |
| - run: echo "::set-output name=dir::$(yarn cache dir)" |
20 |
| - |
21 |
| - - uses: actions/cache@v2 |
22 |
| - with: |
23 |
| - path: | |
24 |
| - ${{ steps.yarn-cache-dir-path.outputs.dir }} |
25 |
| - packages/*/.next/cache |
26 |
| - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} |
27 |
| - restore-keys: | |
28 |
| - ${{ runner.os }}-yarn- |
29 |
| -
|
30 |
| - - run: yarn install --prefer-offline |
31 |
| - |
32 |
| - - run: DEBUG=eslint:cli-engine yarn lint:all |
33 |
| - |
34 |
| - - run: yarn build |
35 |
| - |
36 |
| - - run: yarn test |
37 |
| - env: |
38 |
| - CI: true |
39 |
| - |
40 |
| - - run: echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV |
41 |
| - |
42 |
| - - run: yarn publish:release ${TAG} --yes |
43 |
| - if: ${{ env.TAG != '' && !contains(env.TAG, '/') && !contains(env.TAG, '-') }} |
44 |
| - env: |
45 |
| - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
46 |
| - |
47 |
| - - run: yarn publish:release ${TAG} --yes --dist-tag next |
48 |
| - if: ${{ env.TAG != '' && !contains(env.TAG, '/') && contains(env.TAG, '-') }} |
49 |
| - env: |
50 |
| - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
51 |
| - |
52 |
| -# - run: yarn test:coverage |
53 |
| -# env: |
54 |
| -# COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} |
55 |
| -# - uses: coverallsapp/github-action@master |
56 |
| -# if: success() |
57 |
| -# with: |
58 |
| -# github-token: ${{ secrets.GITHUB_TOKEN }} |
59 |
| -# path-to-lcov: 'packages/*/coverage/lcov.info' |
| 14 | + - uses: actions/checkout@v2 |
| 15 | + |
| 16 | + - uses: actions/setup-node@v1 |
| 17 | + with: |
| 18 | + node-version: '15.x' |
| 19 | + registry-url: 'https://registry.npmjs.org' |
| 20 | + |
| 21 | + - id: yarn-cache-dir-path |
| 22 | + run: echo "::set-output name=dir::$(yarn cache dir)" |
| 23 | + |
| 24 | + - uses: actions/cache@v2 |
| 25 | + with: |
| 26 | + path: | |
| 27 | + ${{ steps.yarn-cache-dir-path.outputs.dir }} |
| 28 | + packages/*/.next/cache |
| 29 | + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} |
| 30 | + restore-keys: | |
| 31 | + ${{ runner.os }}-yarn- |
| 32 | +
|
| 33 | + - run: yarn install --prefer-offline |
| 34 | + |
| 35 | + - run: DEBUG=eslint:cli-engine yarn lint:all |
| 36 | + |
| 37 | + - run: yarn build |
| 38 | + |
| 39 | + - run: yarn test |
| 40 | + env: |
| 41 | + CI: true |
| 42 | + |
| 43 | + - run: echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV |
| 44 | + |
| 45 | + - run: yarn publish:release ${TAG} --yes |
| 46 | + if: ${{ env.TAG != '' && !contains(env.TAG, '/') && !contains(env.TAG, '-') }} |
| 47 | + env: |
| 48 | + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
| 49 | + |
| 50 | + - run: yarn publish:release ${TAG} --yes --dist-tag next |
| 51 | + if: ${{ env.TAG != '' && !contains(env.TAG, '/') && contains(env.TAG, '-') }} |
| 52 | + env: |
| 53 | + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
| 54 | + |
| 55 | + - uses: coverallsapp/github-action@master |
| 56 | + if: success() |
| 57 | + with: |
| 58 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 59 | + path-to-lcov: packages/wrapper/coverage/lcov.info |
| 60 | + base-path: packages/wrapper |
0 commit comments