diff --git a/.github/workflows/rust_build.yml b/.github/workflows/rust_build.yml index d3e51c5..4b59f9b 100644 --- a/.github/workflows/rust_build.yml +++ b/.github/workflows/rust_build.yml @@ -43,7 +43,7 @@ jobs: with: # (required) Comma-separated list of binary names (non-extension portion of filename) to build and upload. # Note that glob pattern is not supported yet. - bin: ws-cli + bin: ws # (optional) Target triple, default is host triple. target: ${{ matrix.target }} # (required) GitHub token for uploading assets to GitHub Releases. diff --git a/Cargo.toml b/Cargo.toml index 583a4ae..31e3664 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,6 +9,16 @@ license = "MIT" keywords = ["workspace", "cli", "cargo"] categories = ["command-line-utilities", "development-tools::cargo-plugins"] +# use in Github workflow `release` +[[bin]] +name = "ws" +path = "src/main.rs" + +# Used when Bunding for OSX +[[bin]] +name = "ws-cli" +path = "src/main.rs" + # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -16,15 +26,16 @@ categories = ["command-line-utilities", "development-tools::cargo-plugins"] clap = { version = "4.4.11", features = ["cargo", "derive", "string"] } toml_edit = "0.21.0" +# Used when Bunding for OSX [package.metadata.bundle] -name = "ws-cli" # The name of your application -identifier = "com.codeitlikemiley.ws-cli" # The bundle identifier of your application +name = "ws" # The name of your application +identifier = "com.codeitlikemiley.ws" # The bundle identifier of your application copyright = "Copyright (c) codeitlikemiley 2023. All rights reserved." category = "Developer Tool" short_description = "A Workspace CLI for managing GRPC Server Workspace" long_description = "A Workspace CLI for managing GRPC Server Workspace" version = "0.1.0" # Version of your application -osx_url_schemes = ["com.codeitlikemiley.ws-cli"] +osx_url_schemes = ["com.codeitlikemiley.ws"] script = "scripts/postinstall" # Path to your postinstall script [profile.release] diff --git a/provision.sh b/provision.sh index 277d5e1..6ff2457 100755 --- a/provision.sh +++ b/provision.sh @@ -1,7 +1,7 @@ #!/bin/sh cargo clean -rm ws-cli.pkg +rm ws.pkg cargo zigbuild --release cargo bundle --release -pkgbuild --root ./target/release/bundle/osx/ws-cli.app --install-location "/Applications/ws-cli.app" --identifier com.codeitlikemiley.ws-cli --version 0.1.0 --scripts ./scripts ws-cli.pkg +pkgbuild --root ./target/release/bundle/osx/ws.app --install-location "/Applications/ws.app" --identifier com.codeitlikemiley.ws --version 0.1.0 --scripts ./scripts ws.pkg diff --git a/scripts/postinstall b/scripts/postinstall index 61af9a6..cb1f171 100755 --- a/scripts/postinstall +++ b/scripts/postinstall @@ -17,4 +17,4 @@ if [ -L "$USER_HOME/.local/bin/ws" ]; then fi # Create the symlink in ~/.local/bin -ln -s "/Applications/ws-cli.app/Contents/MacOS/ws-cli" "$USER_HOME/.local/bin/ws" +ln -s "/Applications/ws.app/Contents/MacOS/ws-cli" "$USER_HOME/.local/bin/ws"