Skip to content

Commit fcc56f6

Browse files
authored
Merge pull request #28 from ipfs-shipyard/ci/js-test-and-release
ci: update js-test-and-release.yml
2 parents a749ff9 + 5adb617 commit fcc56f6

File tree

1 file changed

+19
-51
lines changed

1 file changed

+19
-51
lines changed
Lines changed: 19 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,28 @@
11
name: test & maybe release
2+
23
on:
34
push:
45
branches:
56
- main
67
pull_request:
8+
workflow_dispatch:
79

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
2115

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
4019

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

Comments
 (0)