@prmichaelsen/firebase-admin-sdk-v8 2.7.0 → 2.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15,7 +15,13 @@
15
15
  "WebFetch(domain:firebase.google.com)",
16
16
  "WebFetch(domain:developers.google.com)",
17
17
  "Bash(npx tsc:*)",
18
- "Bash(node --env-file=.env node_modules/.bin/jest --config jest.e2e.config.js --testPathPatterns='firestore/operations.e2e' 2>&1 | tail -20)"
18
+ "Bash(node --env-file=.env node_modules/.bin/jest --config jest.e2e.config.js --testPathPatterns='firestore/operations.e2e' 2>&1 | tail -20)",
19
+ "Bash(npm pack:*)",
20
+ "Bash(npm view:*)",
21
+ "WebFetch(domain:raw.githubusercontent.com)",
22
+ "Bash(node --env-file=.env node_modules/.bin/jest --config jest.e2e.config.js --testPathPattern='user-management')",
23
+ "Bash(node --env-file=.env node_modules/.bin/jest --config jest.e2e.config.js -- user-management)",
24
+ "Bash(node --env-file=.env node_modules/.bin/jest --config jest.e2e.config.js)"
19
25
  ]
20
26
  }
21
27
  }
@@ -0,0 +1,75 @@
1
+ name: Publish to npm
2
+
3
+ on:
4
+ push:
5
+ branches: [mainline]
6
+
7
+ jobs:
8
+ publish:
9
+ runs-on: ubuntu-latest
10
+ permissions:
11
+ contents: read
12
+ steps:
13
+ - uses: actions/checkout@v4
14
+ with:
15
+ fetch-depth: 2
16
+
17
+ - uses: actions/setup-node@v4
18
+ with:
19
+ node-version: 20
20
+ registry-url: https://registry.npmjs.org
21
+ cache: 'npm'
22
+
23
+ - name: Install dependencies
24
+ run: npm ci
25
+
26
+ - name: Build
27
+ run: npm run build
28
+
29
+ - name: Run unit tests
30
+ run: npm test
31
+
32
+ - name: Create service account file
33
+ run: echo '${{ secrets.FIREBASE_SERVICE_ACCOUNT }}' > service-account.json
34
+
35
+ - name: Run e2e tests
36
+ run: npm run test:e2e
37
+ env:
38
+ NODE_ENV: test
39
+
40
+ - name: Clean up service account file
41
+ if: always()
42
+ run: rm -f service-account.json
43
+
44
+ - name: Check if version changed
45
+ id: version
46
+ run: |
47
+ CURRENT=$(node -p "require('./package.json').version")
48
+ PREVIOUS=$(git show HEAD~1:package.json 2>/dev/null | node -p "JSON.parse(require('fs').readFileSync('/dev/stdin','utf8')).version" 2>/dev/null || echo "")
49
+ if [ "$CURRENT" != "$PREVIOUS" ]; then
50
+ echo "changed=true" >> "$GITHUB_OUTPUT"
51
+ echo "version=$CURRENT" >> "$GITHUB_OUTPUT"
52
+ else
53
+ echo "changed=false" >> "$GITHUB_OUTPUT"
54
+ fi
55
+
56
+ - name: Publish
57
+ if: steps.version.outputs.changed == 'true'
58
+ run: npm publish --access public
59
+ env:
60
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
61
+
62
+ - name: Summary
63
+ run: |
64
+ if [ "${{ steps.version.outputs.changed }}" == "true" ]; then
65
+ echo "### 📦 Published to npm" >> "$GITHUB_STEP_SUMMARY"
66
+ echo "" >> "$GITHUB_STEP_SUMMARY"
67
+ echo "**Package**: \`@prmichaelsen/firebase-admin-sdk-v8@${{ steps.version.outputs.version }}\`" >> "$GITHUB_STEP_SUMMARY"
68
+ echo "" >> "$GITHUB_STEP_SUMMARY"
69
+ echo "[View on npm](https://www.npmjs.com/package/@prmichaelsen/firebase-admin-sdk-v8/v/${{ steps.version.outputs.version }})" >> "$GITHUB_STEP_SUMMARY"
70
+ else
71
+ CURRENT=$(node -p "require('./package.json').version")
72
+ echo "### ⏭️ Publish skipped" >> "$GITHUB_STEP_SUMMARY"
73
+ echo "" >> "$GITHUB_STEP_SUMMARY"
74
+ echo "Version \`$CURRENT\` unchanged — no publish needed." >> "$GITHUB_STEP_SUMMARY"
75
+ fi