|
5 | 5 | branches:
|
6 | 6 | - master
|
7 | 7 |
|
| 8 | +# Add this at the top level to ensure we have proper permissions |
8 | 9 | permissions:
|
9 | 10 | contents: write
|
| 11 | + packages: write # Add this if you're using GitHub Packages |
| 12 | + id-token: write # Add this for better security with secrets |
10 | 13 |
|
11 | 14 | jobs:
|
12 | 15 | publish_packages:
|
13 | 16 | runs-on: ubuntu-latest
|
| 17 | + environment: prod |
| 18 | + |
14 | 19 | steps:
|
15 | 20 | - uses: actions/checkout@v4
|
| 21 | + |
| 22 | + - name: Verify Secret Availability |
| 23 | + run: | |
| 24 | + if [ -z "${{ secrets.NPM_TOKEN }}" ]; then |
| 25 | + echo "NPM_TOKEN secret is not set" |
| 26 | + exit 1 |
| 27 | + else |
| 28 | + echo "NPM_TOKEN secret is available" |
| 29 | + fi |
| 30 | +
|
16 | 31 | - name: Use Node.js
|
17 | 32 | uses: actions/setup-node@v4
|
18 | 33 | with:
|
19 | 34 | node-version: "20"
|
20 | 35 | cache: "npm"
|
21 | 36 | registry-url: "https://registry.npmjs.org"
|
| 37 | + |
22 | 38 | - name: git config
|
23 | 39 | run: |
|
24 | 40 | git config user.name "${GITHUB_ACTOR}"
|
25 | 41 | git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
|
26 |
| - - name: "NPM Identity" |
| 42 | +
|
| 43 | + - name: Configure NPM Authentication |
27 | 44 | env:
|
28 |
| - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |
29 |
| - BLA: as |
| 45 | + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
30 | 46 | run: |
|
31 |
| - echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc |
| 47 | + echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" > .npmrc |
32 | 48 | cat .npmrc
|
33 |
| - echo ${{ secrets.NPM_TOKEN }} |
34 |
| - echo $BLA |
35 |
| -
|
36 |
| - # - name: Install dependencies |
37 |
| - # run: npm ci |
38 |
| - # - name: Run tests |
39 |
| - # run: npx lerna run test:e2e --since master |
40 |
| - # - name: Build packages |
41 |
| - # run: npx lerna run build:packages --since master |
42 |
| - # - name: Publish packages |
43 |
| - # run: npx lerna publish patch --no-verify-access --yes |
44 |
| - |
45 |
| - # rmw-shell-demo: |
46 |
| - # if: ${{ always() }} |
47 |
| - # needs: [publish_packages] |
48 |
| - # runs-on: ubuntu-latest |
49 |
| - # environment: prod |
50 |
| - # steps: |
51 |
| - # - uses: actions/checkout@v4 |
52 |
| - # - uses: actions/setup-node@v4 |
53 |
| - # with: |
54 |
| - # node-version: "20" |
55 |
| - # - name: git config |
56 |
| - # run: | |
57 |
| - # git config user.name "${GITHUB_ACTOR}" |
58 |
| - # git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" |
59 |
| - # - name: install-rmw-shell |
60 |
| - # run: npm create @ecronix/rmw-shell@latest demo-app |
61 |
| - # - name: install firebase functins dependencies |
62 |
| - # run: npm i |
63 |
| - # working-directory: ./demo-app/firebase/functions |
64 |
| - # - name: run build |
65 |
| - # run: | |
66 |
| - # npm run build |
67 |
| - # env: |
68 |
| - # CI: false |
69 |
| - # working-directory: ./demo-app |
70 |
| - # - name: Install firebase tools |
71 |
| - # run: npm i -g firebase-tools |
72 |
| - # - name: Deploy |
73 |
| - # run: | |
74 |
| - # firebase use prod |
75 |
| - # firebase deploy --only hosting --token $FIREBASE_TOKEN |
76 |
| - # working-directory: ./demo-app |
77 |
| - # env: |
78 |
| - # FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} |
0 commit comments