Skip to content

Commit 289e857

Browse files
authored
Merge pull request #12 from cawalch/ps/rr/build__npm_build_and_publish_gh_actions_try_6
build: npm build and publish GH actions try 6
2 parents c2692ab + cfad3bc commit 289e857

File tree

1 file changed

+24
-7
lines changed

1 file changed

+24
-7
lines changed

.github/workflows/CI.yml

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -209,21 +209,31 @@ jobs:
209209
with:
210210
path: artifacts
211211

212-
- name: Move artifacts
212+
- name: Debug artifact structure
213213
run: |
214-
# Create npm directory structure if it doesn't exist
215-
mkdir -p npm
214+
echo "Artifact directory structure:"
215+
find artifacts -type f | sort
216216
217-
# Move artifacts to the correct location for napi-rs
217+
- name: Create npm directory structure
218+
run: |
219+
# Create npm directory structure
220+
mkdir -p npm/darwin-x64
221+
mkdir -p npm/darwin-arm64
222+
mkdir -p npm/linux-x64-gnu
223+
224+
- name: Move artifacts to root
225+
run: |
226+
# Copy artifacts to root for GitHub release
218227
find artifacts -name "*.node" -type f -exec cp {} . \;
219228
220-
# Run the artifacts script to organize files correctly
221-
npm run artifacts
229+
- name: Run artifacts script
230+
run: npm run artifacts
222231

223232
- name: List packages
224233
run: |
225234
echo "Files in npm directories:"
226235
ls -la npm/ || echo "No npm directory"
236+
ls -la npm/*/ || echo "No platform subdirectories"
227237
228238
echo "Files in root:"
229239
ls -la *.node || echo "No .node files in root"
@@ -253,6 +263,13 @@ jobs:
253263
else
254264
echo "Updating version from $PACKAGE_VERSION to $RELEASE_VERSION"
255265
npm version $RELEASE_VERSION --no-git-tag-version
266+
267+
# Also update version in platform-specific package.json files
268+
for dir in npm/darwin-x64 npm/darwin-arm64 npm/linux-x64-gnu; do
269+
if [ -f "$dir/package.json" ]; then
270+
node -e "const pkg = require('./$dir/package.json'); pkg.version = '$RELEASE_VERSION'; require('fs').writeFileSync('./$dir/package.json', JSON.stringify(pkg, null, 2));"
271+
fi
272+
done
256273
fi
257274
258275
- name: Publish to npm
@@ -267,6 +284,6 @@ jobs:
267284
*.node
268285
# If triggered by a tag push, create a release
269286
tag_name: ${{ github.ref_name }}
270-
# Only generate release if one doesn't exist
287+
# Only generate release notes if one doesn't exist
271288
generate_release_notes: ${{ github.event_name != 'release' }}
272289

0 commit comments

Comments
 (0)