|
1 | | -name: CI |
2 | | - |
3 | | -on: |
4 | | - push: |
5 | | - branches: [ main, develop ] |
6 | | - pull_request: |
7 | | - branches: [ main, develop ] |
8 | | - |
9 | | -jobs: |
10 | | - test: |
11 | | - runs-on: ubuntu-latest |
12 | | - |
13 | | - strategy: |
14 | | - matrix: |
15 | | - node-version: [18.x, 20.x] |
16 | | - |
17 | | - steps: |
18 | | - - uses: actions/checkout@v6 |
19 | | - |
20 | | - - name: Use Node.js ${{ matrix.node-version }} |
21 | | - uses: actions/setup-node@v6 |
22 | | - with: |
23 | | - node-version: ${{ matrix.node-version }} |
24 | | - cache: 'npm' |
25 | | - |
26 | | - - name: Install dependencies |
27 | | - run: npm ci |
28 | | - |
29 | | - - name: Run linter |
30 | | - run: npm run lint || true |
31 | | - continue-on-error: true |
32 | | - |
33 | | - - name: Run tests |
34 | | - run: npm test || true |
35 | | - continue-on-error: true |
36 | | - |
37 | | - - name: Verify installation |
38 | | - run: | |
39 | | - node -e "console.log('Node.js version:', process.version)" |
40 | | - npm list --depth=0 || true |
41 | | -
|
42 | | - publish: |
43 | | - needs: test |
44 | | - runs-on: ubuntu-latest |
45 | | - if: github.event_name == 'release' && github.event.action == 'published' |
46 | | - |
47 | | - steps: |
48 | | - - uses: actions/checkout@v6 |
49 | | - |
50 | | - - name: Use Node.js |
51 | | - uses: actions/setup-node@v6 |
52 | | - with: |
53 | | - node-version: '20.x' |
54 | | - registry-url: 'https://registry.npmjs.org' |
55 | | - |
56 | | - - name: Install dependencies |
57 | | - run: npm ci |
58 | | - |
59 | | - - name: Publish to npm |
60 | | - run: npm publish --access public |
61 | | - env: |
62 | | - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
63 | | - |
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ main, develop ] |
| 6 | + pull_request: |
| 7 | + branches: [ main, develop ] |
| 8 | + |
| 9 | +jobs: |
| 10 | + test: |
| 11 | + runs-on: ubuntu-latest |
| 12 | + |
| 13 | + strategy: |
| 14 | + matrix: |
| 15 | + node-version: [18.x, 20.x] |
| 16 | + |
| 17 | + steps: |
| 18 | + - uses: actions/checkout@v6 |
| 19 | + |
| 20 | + - name: Use Node.js ${{ matrix.node-version }} |
| 21 | + uses: actions/setup-node@v6 |
| 22 | + with: |
| 23 | + node-version: ${{ matrix.node-version }} |
| 24 | + cache: 'npm' |
| 25 | + |
| 26 | + - name: Install dependencies |
| 27 | + run: npm ci |
| 28 | + |
| 29 | + - name: Run linter |
| 30 | + run: npm run lint || true |
| 31 | + continue-on-error: true |
| 32 | + |
| 33 | + - name: Run tests |
| 34 | + run: npm test || true |
| 35 | + continue-on-error: true |
| 36 | + |
| 37 | + - name: Verify installation |
| 38 | + run: | |
| 39 | + node -e "console.log('Node.js version:', process.version)" |
| 40 | + npm list --depth=0 || true |
| 41 | +
|
| 42 | + publish: |
| 43 | + needs: test |
| 44 | + runs-on: ubuntu-latest |
| 45 | + if: github.event_name == 'release' && github.event.action == 'published' |
| 46 | + |
| 47 | + steps: |
| 48 | + - uses: actions/checkout@v6 |
| 49 | + |
| 50 | + - name: Use Node.js |
| 51 | + uses: actions/setup-node@v6 |
| 52 | + with: |
| 53 | + node-version: '20.x' |
| 54 | + registry-url: 'https://registry.npmjs.org' |
| 55 | + |
| 56 | + - name: Install dependencies |
| 57 | + run: npm ci |
| 58 | + |
| 59 | + - name: Publish to npm |
| 60 | + run: npm publish --access public |
| 61 | + env: |
| 62 | + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
| 63 | + |
0 commit comments