@@ -54,33 +54,30 @@ jobs:
5454 echo "Building for architecture: $(arch)"
5555 CURRENT_ARCH=$(arch)
5656
57- # Build native dependencies and JavaScript
57+ # Build native dependencies and JavaScript (this creates dist/node14 and dist/node16)
5858 BUILD=1 npm install
5959 npm run build
6060
61- # Verify native binary was built
62- if [ ! -f "build/Release/ rapid-client.node" ]; then
63- echo "Error: Native binary not found at build/Release/rapid-client.node "
61+ # Verify required files were created
62+ if [ ! -f "dist/ rapid-client.node" ] || [ ! -f "dist/index.mjs" ] || [ ! -f "dist/UserFunction.js " ]; then
63+ echo "Error: Required files not found in dist directory "
6464 exit 1
6565 fi
6666
67- # Copy native binary to dist directory
68- mkdir -p dist
69- cp build/Release/rapid-client.node dist/
70-
71- # Create architecture-specific package name
67+ # Copy architecture-specific package.json to dist
7268 node -e "
7369 const pkg = require('./package.json');
7470 pkg.name = 'aws-lambda-ric-' + process.env.CURRENT_ARCH;
75- require('fs').writeFileSync('./package.json', JSON.stringify(pkg, null, 2));
71+ require('fs').writeFileSync('./dist/ package.json', JSON.stringify(pkg, null, 2));
7672 " CURRENT_ARCH=$CURRENT_ARCH
7773
78- npm pack
74+ # Create tarball from dist directory
75+ cd dist && tar -czf ../aws-lambda-ric-$CURRENT_ARCH-${{ needs.get-version.outputs.version }}.tgz .
7976
8077 - name : Generate checksums
8178 run : |
82- PACKAGE_FILE=$(ls aws-lambda-ric-*.tgz)
8379 CURRENT_ARCH=$(arch)
80+ PACKAGE_FILE="aws-lambda-ric-$CURRENT_ARCH-${{ needs.get-version.outputs.version }}.tgz"
8481 sha256sum $PACKAGE_FILE > checksums-$CURRENT_ARCH.sha256
8582 sha512sum $PACKAGE_FILE > checksums-$CURRENT_ARCH.sha512
8683 echo "Package: $PACKAGE_FILE ($CURRENT_ARCH) with version: ${{ needs.get-version.outputs.version }}" > checksums-$CURRENT_ARCH.txt
9087 with :
9188 name : package-${{ matrix.arch }}-${{ needs.get-version.outputs.version }}
9289 path : |
93- aws-lambda-ric-*.tgz
90+ aws-lambda-ric-${{ matrix.arch }}- *.tgz
9491 checksums-*.*
9592 retention-days : 30
9693
@@ -164,7 +161,7 @@ jobs:
164161
165162 # Publish architecture-specific packages
166163 for arch in x86_64 aarch64; do
167- PACKAGE_FILE=$(ls ./artifacts/$arch/aws-lambda-ric-*.tgz)
164+ PACKAGE_FILE=$(ls ./artifacts/$arch/aws-lambda-ric-$arch- *.tgz)
168165 echo "Publishing $PACKAGE_FILE for architecture $arch"
169166 npm publish $PACKAGE_FILE $TAG_FLAG --access=public
170167 done
@@ -180,6 +177,6 @@ jobs:
180177 uses : softprops/action-gh-release@v2
181178 with :
182179 files : |
183- ./artifacts/*/aws-lambda-ric-*.tgz
180+ ./artifacts/*/aws-lambda-ric-*-* .tgz
184181 combined-checksums.*
185182 prerelease : ${{ steps.version.outputs.is_rc }}
0 commit comments