Skip to content

Commit

Permalink
👷 Set release tag
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrielePicco committed Feb 22, 2024
1 parent c6d67ad commit 9aba2dd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
23 changes: 11 additions & 12 deletions .github/workflows/publish-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:
command: build
args: --manifest-path=cli/Cargo.toml --no-default-features --release --locked --target ${{ matrix.build.TARGET }}

- name: Build and publish the NPM package
- name: Build the NPM package
shell: bash
run: |
# set the binary name
Expand Down Expand Up @@ -118,24 +118,23 @@ jobs:
fi
echo "bin_name=${bin}" >> $GITHUB_ENV
cp "target/${{ matrix.build.TARGET }}/release/${bin}" "${node_pkg}/bin"
# publish the package
cd "${node_pkg}"
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
npm set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TOKEN }}
npm publish --access public --dry-run
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish binary to GitHub release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ env.node_pkg }}/bin/${{ env.bin_name }}
overwrite: true
tag: ${{ github.ref }}
tag: "v${{ env.RELEASE_VERSION }}"
release_name: "v${{ env.RELEASE_VERSION }}"
asset_name: ${{ matrix.NAME }}

- uses: actions/setup-node@v4
with:
node-version: 20
- name: Publish the NPM package
shell: bash
run: |
cd "${env.node_pkg}"
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
npm set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TOKEN }}
npm publish --access public --dry-run
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
5 changes: 1 addition & 4 deletions cli/npm-package/package.json.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,5 @@
],
"cpu": [
"${node_arch}"
],
"publishConfig": {
"registry": "https://npm.pkg.github.com"
}
]
}

0 comments on commit 9aba2dd

Please sign in to comment.