@@ -49,49 +49,45 @@ jobs:
4949 apt-get update
5050 apt-get install -y cmake make g++ autotools-dev automake libtool
5151
52- - name : Build natively for $( arch)
52+ - name : Build natively for ${{ matrix. arch }}
5353 run : |
54- echo "Building for architecture: $(arch)"
55- CURRENT_ARCH=$(arch)
54+ echo "Building for architecture: ${{ matrix.arch }}"
5655
57- # Build native dependencies and JavaScript
56+ # Build native dependencies and JavaScript
5857 BUILD=1 npm install
5958 npm run build
6059
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 "
60+ # Verify required files were created
61+ if [ ! -f "dist/ rapid-client.node" ] || [ ! -f "dist/index.mjs" ] || [ ! -f "dist/UserFunction.js " ]; then
62+ echo "Error: Required files not found in dist directory "
6463 exit 1
6564 fi
6665
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
66+ # Copy architecture-specific package.json to dist
7267 node -e "
7368 const pkg = require('./package.json');
74- pkg.name = 'aws-lambda-ric-' + process.env.CURRENT_ARCH ;
75- require('fs').writeFileSync('./package.json', JSON.stringify(pkg, null, 2));
76- " CURRENT_ARCH=$CURRENT_ARCH
69+ pkg.name = 'aws-lambda-ric-${{ matrix.arch }}' ;
70+ require('fs').writeFileSync('./dist/ package.json', JSON.stringify(pkg, null, 2));
71+ "
7772
78- npm pack
73+ # Create tarball with only required files
74+ tar -czf aws-lambda-ric-${{ matrix.arch }}-${{ needs.get-version.outputs.version }}.tgz \
75+ -C dist package.json index.mjs UserFunction.js rapid-client.node
7976
8077 - name : Generate checksums
8178 run : |
82- PACKAGE_FILE=$(ls aws-lambda-ric-*.tgz)
83- CURRENT_ARCH=$(arch)
84- sha256sum $PACKAGE_FILE > checksums-$CURRENT_ARCH.sha256
85- sha512sum $PACKAGE_FILE > checksums-$CURRENT_ARCH.sha512
86- echo "Package: $PACKAGE_FILE ($CURRENT_ARCH) with version: ${{ needs.get-version.outputs.version }}" > checksums-$CURRENT_ARCH.txt
79+ PACKAGE_FILE="aws-lambda-ric-${{ matrix.arch }}-${{ needs.get-version.outputs.version }}.tgz"
80+ sha256sum $PACKAGE_FILE > checksums-${{ matrix.arch }}.sha256
81+ sha512sum $PACKAGE_FILE > checksums-${{ matrix.arch }}.sha512
82+ echo "Package: $PACKAGE_FILE (${{ matrix.arch }}) with version: ${{ needs.get-version.outputs.version }}" > checksums-${{ matrix.arch }}.txt
8783
8884 - name : Upload artifacts
8985 uses : actions/upload-artifact@v4
9086 with :
9187 name : package-${{ matrix.arch }}-${{ needs.get-version.outputs.version }}
9288 path : |
93- aws-lambda-ric-*.tgz
94- checksums-*.*
89+ aws-lambda-ric-*-${{ needs.get-version.outputs.version }} .tgz
90+ checksums-*
9591 retention-days : 30
9692
9793 test :
@@ -162,12 +158,10 @@ jobs:
162158 TAG_FLAG=""
163159 fi
164160
165- # Publish architecture-specific packages
166- for arch in x86_64 aarch64; do
167- PACKAGE_FILE=$(ls ./artifacts/$arch/aws-lambda-ric-*.tgz)
168- echo "Publishing $PACKAGE_FILE for architecture $arch"
169- npm publish $PACKAGE_FILE $TAG_FLAG --access=public
170- done
161+ # Build and publish full package to npm
162+ BUILD=1 npm install
163+ npm run build
164+ npm publish $TAG_FLAG --access=public
171165
172166 - name : Combine checksums
173167 run : |
@@ -180,6 +174,6 @@ jobs:
180174 uses : softprops/action-gh-release@v2
181175 with :
182176 files : |
183- ./artifacts/*/aws-lambda-ric-*.tgz
177+ ./artifacts/*/aws-lambda-ric-*-* .tgz
184178 combined-checksums.*
185179 prerelease : ${{ steps.version.outputs.is_rc }}
0 commit comments