@@ -54,33 +54,31 @@ jobs:
54
54
echo "Building for architecture: $(arch)"
55
55
CURRENT_ARCH=$(arch)
56
56
57
- # Build native dependencies and JavaScript
57
+ # Build native dependencies and JavaScript (this creates dist/node14 and dist/node16)
58
58
BUILD=1 npm install
59
59
npm run build
60
60
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 "
64
64
exit 1
65
65
fi
66
66
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
72
68
node -e "
73
69
const pkg = require('./package.json');
74
70
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));
76
72
" CURRENT_ARCH=$CURRENT_ARCH
77
73
78
- npm pack
74
+ # Create tarball with only required files
75
+ tar -czf aws-lambda-ric-$CURRENT_ARCH-${{ needs.get-version.outputs.version }}.tgz \
76
+ -C dist package.json index.mjs UserFunction.js rapid-client.node
79
77
80
78
- name : Generate checksums
81
79
run : |
82
- PACKAGE_FILE=$(ls aws-lambda-ric-*.tgz)
83
80
CURRENT_ARCH=$(arch)
81
+ PACKAGE_FILE="aws-lambda-ric-$CURRENT_ARCH-${{ needs.get-version.outputs.version }}.tgz"
84
82
sha256sum $PACKAGE_FILE > checksums-$CURRENT_ARCH.sha256
85
83
sha512sum $PACKAGE_FILE > checksums-$CURRENT_ARCH.sha512
86
84
echo "Package: $PACKAGE_FILE ($CURRENT_ARCH) with version: ${{ needs.get-version.outputs.version }}" > checksums-$CURRENT_ARCH.txt
90
88
with :
91
89
name : package-${{ matrix.arch }}-${{ needs.get-version.outputs.version }}
92
90
path : |
93
- aws-lambda-ric-*.tgz
94
- checksums-*.*
91
+ aws-lambda-ric-*-${{ needs.get-version.outputs.version }} .tgz
92
+ checksums-*
95
93
retention-days : 30
96
94
97
95
test :
@@ -164,7 +162,7 @@ jobs:
164
162
165
163
# Publish architecture-specific packages
166
164
for arch in x86_64 aarch64; do
167
- PACKAGE_FILE=$(ls ./artifacts/$arch/aws-lambda-ric-*.tgz)
165
+ PACKAGE_FILE=$(ls ./artifacts/$arch/aws-lambda-ric-$arch- *.tgz)
168
166
echo "Publishing $PACKAGE_FILE for architecture $arch"
169
167
npm publish $PACKAGE_FILE $TAG_FLAG --access=public
170
168
done
@@ -180,6 +178,6 @@ jobs:
180
178
uses : softprops/action-gh-release@v2
181
179
with :
182
180
files : |
183
- ./artifacts/*/aws-lambda-ric-*.tgz
181
+ ./artifacts/*/aws-lambda-ric-*-* .tgz
184
182
combined-checksums.*
185
183
prerelease : ${{ steps.version.outputs.is_rc }}
0 commit comments