Skip to content

Commit

Permalink
👷 Update binary name
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrielePicco committed Feb 22, 2024
1 parent 9aba2dd commit 54e2ffc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/publish-packages.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Publish bolt-cli packages
on:
pull_request:
workflow_dispatch:

env:
release_version: 0.0.1
Expand Down Expand Up @@ -118,21 +119,30 @@ jobs:
fi
echo "bin_name=${bin}" >> $GITHUB_ENV
cp "target/${{ matrix.build.TARGET }}/release/${bin}" "${node_pkg}/bin"
cp "target/${{ matrix.build.TARGET }}/release/${bin}" "${node_pkg}/bin"
# Create the release bin file
release_name="bolt-${{ matrix.build.NAME }}"
if [ "${{ matrix.build.OS }}" = "windows-2022" ]; then
release_name="${release_name}.exe"
fi
echo "release_name=${release_name}" >> $GITHUB_ENV
mv "target/${{ matrix.build.TARGET }}/release/${bin}" "target/${{ matrix.build.TARGET }}/release/${release_name}"
- 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 }}
file: target/${{ matrix.build.TARGET }}/release/${{ env.release_name }}
overwrite: true
tag: "v${{ env.RELEASE_VERSION }}"
release_name: "v${{ env.RELEASE_VERSION }}"
asset_name: ${{ matrix.NAME }}
asset_name: "bolt-${{ matrix.NAME }}"

- name: Publish the NPM package
shell: bash
run: |
cd "${env.node_pkg}"
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
Expand Down
2 changes: 1 addition & 1 deletion cli/npm-package/bolt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function getExePath(): string {
extension = ".exe";
}

const binaryName = `@magicblock-labs/bolt-${os}-${arch()}/bin/app${extension}`;
const binaryName = `@magicblock-labs/bolt-${os}-${arch()}/bin/bolt${extension}`;
try {
return require.resolve(binaryName);
} catch (e) {
Expand Down

0 comments on commit 54e2ffc

Please sign in to comment.