Skip to content

Commit

Permalink
👷 Publish to github npm registry
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrielePicco committed Feb 22, 2024
1 parent 660339c commit 3e65865
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/publish-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
target: ${{ matrix.build.TARGET }}
override: true

- name: Build
- name: Build the Rust binary
uses: actions-rs/cargo@v1
with:
command: build
Expand All @@ -75,7 +75,7 @@ jobs:
with:
node-version: 20

- name: Publish to NPM
- name: Build the NPM package
shell: bash
run: |
# set the binary name
Expand Down Expand Up @@ -105,8 +105,13 @@ jobs:
bin="${bin}.exe"
fi
cp "target/${{ matrix.build.TARGET }}/release/${bin}" "${node_pkg}/bin"
# publish the package
- name: Publish the package
shell: bash
run: |
cd "${node_pkg}"
echo "//npm.pkg.github.com/:_authToken=${{ secrets.NPM_GITHUB_TOKEN }}" > ~/.npmrc
npm set //npm.pkg.github.com/:_authToken ${{ secrets.NPM_GITHUB_TOKEN }}
npm publish --access public --dry-run
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_GITHUB_TOKEN }}
7 changes: 5 additions & 2 deletions cli/npm-package/package.json.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "${node_pkg}",
"name": "@magicblock-labs/${node_pkg}",
"version": "${node_version}",
"repository": {
"type": "git",
Expand All @@ -12,5 +12,8 @@
],
"cpu": [
"${node_arch}"
]
],
"publishConfig": {
"registry": "https://npm.pkg.github.com"
},
}

0 comments on commit 3e65865

Please sign in to comment.