|
1 | 1 | name: test & maybe release |
| 2 | + |
2 | 3 | on: |
3 | 4 | push: |
4 | 5 | branches: |
5 | 6 | - main |
6 | 7 | pull_request: |
| 8 | + workflow_dispatch: |
7 | 9 |
|
8 | | -jobs: |
9 | | - |
10 | | - check: |
11 | | - runs-on: ubuntu-latest |
12 | | - steps: |
13 | | - - uses: actions/checkout@v3 |
14 | | - - uses: actions/setup-node@v3 |
15 | | - with: |
16 | | - node-version: lts/* |
17 | | - - uses: ipfs/aegir/actions/cache-node-modules@main |
18 | | - - run: npm run --if-present lint |
19 | | - - run: npm run --if-present dep-check |
20 | | - - run: npm run --if-present doc-check |
| 10 | +permissions: |
| 11 | + contents: write |
| 12 | + id-token: write |
| 13 | + packages: write |
| 14 | + pull-requests: write |
21 | 15 |
|
22 | | - test-node: |
23 | | - needs: check |
24 | | - runs-on: ${{ matrix.os }} |
25 | | - strategy: |
26 | | - matrix: |
27 | | - os: [windows-latest, ubuntu-latest, macos-latest] |
28 | | - node: [lts/*] |
29 | | - fail-fast: true |
30 | | - steps: |
31 | | - - uses: actions/checkout@v3 |
32 | | - - uses: actions/setup-node@v3 |
33 | | - with: |
34 | | - node-version: ${{ matrix.node }} |
35 | | - - uses: ipfs/aegir/actions/cache-node-modules@main |
36 | | - - run: npm run --if-present test:node |
37 | | - - uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # v3.1.1 |
38 | | - with: |
39 | | - flags: node |
| 16 | +concurrency: |
| 17 | + group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event_name == 'push' && github.sha || github.ref }} |
| 18 | + cancel-in-progress: true |
40 | 19 |
|
41 | | - release: |
42 | | - needs: [test-node] |
43 | | - runs-on: ubuntu-latest |
44 | | - if: github.event_name == 'push' && github.ref == 'refs/heads/main' |
45 | | - steps: |
46 | | - - uses: actions/checkout@v3 |
47 | | - with: |
48 | | - fetch-depth: 0 |
49 | | - - uses: actions/setup-node@v3 |
50 | | - with: |
51 | | - node-version: lts/* |
52 | | - - uses: ipfs/aegir/actions/cache-node-modules@main |
53 | | - - uses: ipfs/aegir/actions/docker-login@main |
54 | | - with: |
55 | | - docker-token: ${{ secrets.DOCKER_TOKEN }} |
56 | | - docker-username: ${{ secrets.DOCKER_USERNAME }} |
57 | | - - run: npm run --if-present release |
58 | | - env: |
59 | | - GITHUB_TOKEN: ${{ secrets.UCI_GITHUB_TOKEN || github.token }} |
60 | | - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |
| 20 | +jobs: |
| 21 | + js-test-and-release: |
| 22 | + uses: ipdxco/unified-github-workflows/.github/workflows/js-test-and-release.yml@v1 |
| 23 | + secrets: |
| 24 | + DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }} |
| 25 | + DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} |
| 26 | + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |
| 27 | + UCI_GITHUB_TOKEN: ${{ secrets.UCI_GITHUB_TOKEN }} |
| 28 | + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |
0 commit comments