Skip to content

Commit 50265d9

Browse files
author
Fabiana Severin
committed
Adding architecture specific tar
1 parent 595e7e8 commit 50265d9

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

.github/workflows/build-and-release.yml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,29 @@ jobs:
5252
- name: Build natively for $(arch)
5353
run: |
5454
echo "Building for architecture: $(arch)"
55+
CURRENT_ARCH=$(arch)
56+
57+
# Build native dependencies and JavaScript
5558
BUILD=1 npm install
5659
npm run build
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"
64+
exit 1
65+
fi
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
72+
node -e "
73+
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
77+
5778
npm pack
5879
5980
- name: Generate checksums
@@ -141,9 +162,10 @@ jobs:
141162
TAG_FLAG=""
142163
fi
143164
144-
# Publish both architecture packages
165+
# Publish architecture-specific packages
145166
for arch in x86_64 aarch64; do
146167
PACKAGE_FILE=$(ls ./artifacts/$arch/aws-lambda-ric-*.tgz)
168+
echo "Publishing $PACKAGE_FILE for architecture $arch"
147169
npm publish $PACKAGE_FILE $TAG_FLAG --access=public
148170
done
149171

0 commit comments

Comments
 (0)