@@ -49,49 +49,45 @@ jobs:
49
49
apt-get update
50
50
apt-get install -y cmake make g++ autotools-dev automake libtool
51
51
52
- - name : Build natively for $( arch)
52
+ - name : Build natively for ${{ matrix. arch }}
53
53
run : |
54
- echo "Building for architecture: $(arch)"
55
- CURRENT_ARCH=$(arch)
54
+ echo "Building for architecture: ${{ matrix.arch }}"
56
55
57
- # Build native dependencies and JavaScript
56
+ # Build native dependencies and JavaScript
58
57
BUILD=1 npm install
59
58
npm run build
60
59
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 "
64
63
exit 1
65
64
fi
66
65
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
72
67
node -e "
73
68
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
+ "
77
72
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
79
76
80
77
- name : Generate checksums
81
78
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
87
83
88
84
- name : Upload artifacts
89
85
uses : actions/upload-artifact@v4
90
86
with :
91
87
name : package-${{ matrix.arch }}-${{ needs.get-version.outputs.version }}
92
88
path : |
93
- aws-lambda-ric-*.tgz
94
- checksums-*.*
89
+ aws-lambda-ric-*-${{ needs.get-version.outputs.version }} .tgz
90
+ checksums-*
95
91
retention-days : 30
96
92
97
93
test :
@@ -162,12 +158,10 @@ jobs:
162
158
TAG_FLAG=""
163
159
fi
164
160
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
171
165
172
166
- name : Combine checksums
173
167
run : |
@@ -180,6 +174,6 @@ jobs:
180
174
uses : softprops/action-gh-release@v2
181
175
with :
182
176
files : |
183
- ./artifacts/*/aws-lambda-ric-*.tgz
177
+ ./artifacts/*/aws-lambda-ric-*-* .tgz
184
178
combined-checksums.*
185
179
prerelease : ${{ steps.version.outputs.is_rc }}
0 commit comments