Skip to content

Commit

Permalink
ci(js): publish natives under @Codemp scope...
Browse files Browse the repository at this point in the history
... but keep using just codemp for package. to do this, we sed
@codemp/native into just codemp before doing npm publish, because napi
doesnt seem to have a flag to configure that without resorting to
package.json while creating subdirs.
  • Loading branch information
alemidev committed Sep 9, 2024
1 parent d2a6bae commit 46baa48
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/javascript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,19 @@ jobs:
with:
path: dist/js/publish/artifacts
pattern: codemp-js-*
- run: tree; npx napi artifacts; tree
- run: npx napi artifacts
working-directory: dist/js/publish
- run: npx napi prepublish -t . --skip-gh-release
working-directory: dist/js/publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: rm -rf *.node artifacts node_modules
working-directory: dist/js/publish
# TODO this is a bit awful, but napi just appends the platform triplet to the resulting package name
# however we want '@codemp/native-...' and 'codemp' (because otherwise it gets flagged as spam)
# so we just sed out before releasing. this is really ugly but if it works right now i'll just
# take it and think again about it later
- run: sed -i 's/"@codemp\/native"/"codemp"/' package.json
- run: npm publish
working-directory: dist/js/publish
env:
Expand Down
8 changes: 4 additions & 4 deletions dist/js/publish/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "codemp",
"name": "@codemp/native",
"version": "0.0.6",
"devDependencies": {
"@napi-rs/cli": "^2.18.4"
Expand All @@ -8,8 +8,8 @@
"name": "codemp"
},
"optionalDependencies": {
"codemp-win32-x64-msvc": "0.0.4",
"codemp-darwin-arm64": "0.0.4",
"codemp-linux-x64-gnu": "0.0.4"
"@codemp/native-win32-x64-msvc": "0.0.4",
"@codemp/native-darwin-arm64": "0.0.4",
"@codemp/native-linux-x64-gnu": "0.0.4"
}
}

0 comments on commit 46baa48

Please sign in to comment.