@@ -216,24 +216,51 @@ jobs:
216216 with :
217217 node-version : ' 20'
218218
219+ - name : Get NPM token from AWS Secrets Manager
220+ run : |
221+ NPM_TOKEN=$(aws secretsmanager get-secret-value --secret-id NPM-TOKEN --region eu-north-1 --query SecretString --output text | jq -r .token)
222+ echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
223+ echo "registry=https://registry.npmjs.org/" >> ~/.npmrc
224+ echo "Authenticated as: $(npm whoami)"
225+
219226 - name : Test Release Publishing
220227 if : github.event.inputs.test_mode == 'release' || github.ref == 'refs/heads/fabisev/artifact-publishing'
221228 run : |
222- echo "=== TESTING RELEASE PUBLISHING (DRY RUN) ==="
223- echo "Would create a GitHub release with the following files:"
224- ls -la aws-lambda-ric-*.tgz checksums.*
225- echo "\nRelease would include version: ${{ needs.build.outputs.version }}"
229+ echo "=== TESTING RELEASE PUBLISHING ==="
230+ # Extract and modify package for testing
231+ tar -xzf aws-lambda-ric-*.tgz
232+ cd package
233+
234+ PACKAGE_NAME="icecream-shop"
235+ npm pkg set name="${PACKAGE_NAME}"
236+
237+ echo "Package name: ${PACKAGE_NAME}"
238+ echo "Publishing to npm with version: ${{ needs.build.outputs.version }}"
239+
240+ if ! npm publish --access public; then
241+ echo "❌ Publish failed, showing debug logs:"
242+ echo "=== NPM DEBUG LOG ==="
243+ find /root/.npm/_logs -name "*debug*.log" -exec cat {} \; 2>/dev/null || echo "No debug logs found"
244+ echo "=== END DEBUG LOG ==="
245+ exit 1
246+ fi
247+
248+ echo "✅ Successfully published test package to npm!"
226249
227250 - name : Test RC Publishing
228251 if : github.event.inputs.test_mode == 'rc'
229252 run : |
230- echo "=== TESTING RC PUBLISHING (DRY RUN) ==="
253+ echo "=== TESTING RC PUBLISHING ==="
254+ # Extract and modify package for testing
255+ tar -xzf aws-lambda-ric-*.tgz
256+ cd package
257+ PACKAGE_NAME="icecream-shop"
258+ npm pkg set name=PACKAGE_NAME
231259 # Simulate RC version
232260 RC_NUMBER="1"
233261 PACKAGE_VERSION="${{ needs.build.outputs.version }}-rc.${RC_NUMBER}"
234- echo "Would create a GitHub pre-release with the following files:"
235- ls -la aws-lambda-ric-*.tgz checksums.*
236- echo "\nRelease would include version: ${PACKAGE_VERSION}"
237-
238- # Update version for display purposes
239- npm version ${PACKAGE_VERSION} --no-git-tag-version
262+ echo "Publishing RC to npm with version: ${PACKAGE_VERSION}"
263+ # Update version for RC
264+ npm version ${PACKAGE_VERSION} --no-git-tag-version
265+ npm publish --tag rc --access public
266+ echo "✅ Successfully published RC test package to npm!"
0 commit comments