|
3 | 3 | name: Publish Node.js Package |
4 | 4 |
|
5 | 5 | on: |
6 | | - release: |
7 | | - types: [published] |
| 6 | + release: |
| 7 | + types: [published] |
8 | 8 |
|
9 | 9 | permissions: |
10 | | - contents: read |
11 | | - packages: write |
12 | | - id-token: write |
| 10 | + contents: read |
| 11 | + packages: write |
| 12 | + id-token: write |
13 | 13 |
|
14 | 14 | jobs: |
15 | | - build: |
16 | | - runs-on: ubuntu-latest |
17 | | - permissions: |
18 | | - contents: read |
19 | | - steps: |
20 | | - - uses: actions/checkout@v4 |
21 | | - - uses: actions/setup-node@v4 |
22 | | - with: |
23 | | - node-version: 20 |
24 | | - cache: "npm" # Added caching |
25 | | - - run: npm ci |
26 | | - - run: npm run build |
27 | | - - name: Upload build artifacts |
28 | | - uses: actions/upload-artifact@v4 |
29 | | - with: |
30 | | - name: build-output |
31 | | - path: dist/ |
| 15 | + build: |
| 16 | + runs-on: ubuntu-latest |
| 17 | + permissions: |
| 18 | + contents: read |
| 19 | + steps: |
| 20 | + - uses: actions/checkout@v5 |
| 21 | + - uses: actions/setup-node@v6 |
| 22 | + with: |
| 23 | + node-version: 20 |
| 24 | + cache: "npm" # Added caching |
| 25 | + - run: npm ci |
| 26 | + - run: npm run build |
| 27 | + - name: Upload build artifacts |
| 28 | + uses: actions/upload-artifact@v4 |
| 29 | + with: |
| 30 | + name: build-output |
| 31 | + path: dist/ |
32 | 32 |
|
33 | | - publish-gpr: |
34 | | - needs: build |
35 | | - runs-on: ubuntu-latest |
36 | | - permissions: |
37 | | - contents: read |
38 | | - packages: write |
39 | | - steps: |
40 | | - - uses: actions/checkout@v4 |
41 | | - - uses: actions/setup-node@v4 |
42 | | - with: |
43 | | - node-version: 20 |
44 | | - cache: "npm" |
45 | | - registry-url: "https://npm.pkg.github.com" |
46 | | - scope: "@kit-data-manager" |
47 | | - - name: Download build artifacts |
48 | | - uses: actions/download-artifact@v4 |
49 | | - with: |
50 | | - name: build-output |
51 | | - path: dist/ |
52 | | - - run: npm ci |
53 | | - - run: npm publish |
54 | | - env: |
55 | | - NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} |
| 33 | + publish-gpr: |
| 34 | + needs: build |
| 35 | + runs-on: ubuntu-latest |
| 36 | + permissions: |
| 37 | + contents: read |
| 38 | + packages: write |
| 39 | + steps: |
| 40 | + - uses: actions/checkout@v5 |
| 41 | + - uses: actions/setup-node@v6 |
| 42 | + with: |
| 43 | + node-version: 20 |
| 44 | + cache: "npm" |
| 45 | + registry-url: "https://npm.pkg.github.com" |
| 46 | + scope: "@kit-data-manager" |
| 47 | + - name: Download build artifacts |
| 48 | + uses: actions/download-artifact@v4 |
| 49 | + with: |
| 50 | + name: build-output |
| 51 | + path: dist/ |
| 52 | + - run: npm ci |
| 53 | + - run: npm publish |
| 54 | + env: |
| 55 | + NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} |
56 | 56 |
|
57 | | - publish-npm: |
58 | | - needs: build |
59 | | - runs-on: ubuntu-latest |
60 | | - permissions: |
61 | | - contents: read |
62 | | - id-token: write |
63 | | - steps: |
64 | | - - uses: actions/checkout@v4 |
65 | | - - uses: actions/setup-node@v4 |
66 | | - with: |
67 | | - node-version: 20 |
68 | | - cache: "npm" |
69 | | - registry-url: "https://registry.npmjs.org" |
70 | | - - name: Download build artifacts |
71 | | - uses: actions/download-artifact@v4 |
72 | | - with: |
73 | | - name: build-output |
74 | | - path: dist/ |
75 | | - - run: npm ci |
76 | | - - run: npm publish --provenance --access public |
77 | | - env: |
78 | | - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
| 57 | + publish-npm: |
| 58 | + needs: build |
| 59 | + runs-on: ubuntu-latest |
| 60 | + permissions: |
| 61 | + contents: read |
| 62 | + id-token: write |
| 63 | + steps: |
| 64 | + - uses: actions/checkout@v5 |
| 65 | + - uses: actions/setup-node@v6 |
| 66 | + with: |
| 67 | + node-version: 20 |
| 68 | + cache: "npm" |
| 69 | + registry-url: "https://registry.npmjs.org" |
| 70 | + - name: Download build artifacts |
| 71 | + uses: actions/download-artifact@v4 |
| 72 | + with: |
| 73 | + name: build-output |
| 74 | + path: dist/ |
| 75 | + - run: npm ci |
| 76 | + - run: npm publish --provenance --access public |
| 77 | + env: |
| 78 | + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
0 commit comments