Skip to content

Commit

Permalink
fix: make the bin release for moose compatible with igloo bin (#99)
Browse files Browse the repository at this point in the history
  • Loading branch information
callicles authored Dec 16, 2023
1 parent 02954b8 commit 2bf44ec
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions apps/moose-cli-npm/scripts/release-bin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ build_os=$3
build_name=$4

# set the binary name
bin="igloo-cli"
current_bin="igloo-cli"
future_bin="moose-cli"
# derive the OS and architecture from the build matrix name
# note: when split by a hyphen, first part is the OS and the second is the architecture
node_os=$(echo ${build_name} | cut -d '-' -f1)
Expand All @@ -19,9 +20,9 @@ export node_arch
# set the package name
# note: use 'windows' as OS name instead of 'win32'
if [ ${build_os} = "windows-2022" ]; then
export node_pkg="${bin}-windows-${node_arch}"
else
export node_pkg="${bin}-${node_os}-${node_arch}"
export node_pkg="${future_bin}-windows-${node_arch}"
elsen
export node_pkg="${future_bin}-${node_os}-${node_arch}"
fi
# create the package directory
mkdir -p "${node_pkg}/bin"
Expand All @@ -30,12 +31,12 @@ envsubst < package.json.tmpl > "${node_pkg}/package.json"
# copy the binary into the package
# note: windows binaries has '.exe' extension
if [ $build_os = "windows-2022" ]; then
bin="${bin}.exe"
current_bin="${current_bin}.exe"
fi
pwd
ls "../igloo-kit-cli/target/${build_target}/release/${bin}"
cp "../igloo-kit-cli/target/${build_target}/release/${bin}" "../igloo-kit-cli/target/${build_target}/release/${bin}-${build_target}"
cp "../igloo-kit-cli/target/${build_target}/release/${bin}" "${node_pkg}/bin"
ls "../igloo-kit-cli/target/${build_target}/release/${current_bin}"
cp "../igloo-kit-cli/target/${build_target}/release/${current_bin}" "../igloo-kit-cli/target/${build_target}/release/${current_bin}-${build_target}"
cp "../igloo-kit-cli/target/${build_target}/release/${current_bin}" "${node_pkg}/bin"
# publish the package
cd "${node_pkg}"
npm publish --access public

0 comments on commit 2bf44ec

Please sign in to comment.