feat: Use new repo urls and add binary to shell path#46
Conversation
|
It would be helpful to include a bit more context on the changes—just reading the title, I didn’t expect this PR to include quite so much |
There was a problem hiding this comment.
Pull Request Overview
This PR updates the wassette installer script to use new repository URLs and artifact names, while adding functionality to automatically add the binary to the shell's PATH environment variable.
- Updates installer to use new GitHub repository API endpoints and artifact naming convention
- Replaces manual PATH configuration instructions with automatic shell configuration file modification
- Streamlines installation process by automatically configuring PATH in bash/zsh profile files
Copilot was refusing to generate comments for me
My apologies, I meant to open this as a draft. |
install.sh
Outdated
| # Create a system-wide PATH file for immediate recognition | ||
| print_status "Creating PATH configuration in /etc/environment (if writable)" | ||
| if sudo -n true 2>/dev/null; then | ||
| # We have sudo access | ||
| if [[ -f /etc/environment ]]; then | ||
| if ! sudo grep -q "$HOME/.local/bin" /etc/environment 2>/dev/null; then | ||
| echo "PATH=\"$HOME/.local/bin:\$PATH\"" | sudo tee -a /etc/environment > /dev/null | ||
| print_status "Added PATH to /etc/environment" | ||
| fi | ||
|
|
||
| echo "" | ||
| log_info "Next steps:" | ||
| log_info "1. Run '$BINARY_NAME --help' to see available commands" | ||
| log_info "2. Create a policy.yaml file for your tools" | ||
| log_info "3. Start the server with: $BINARY_NAME serve --http --policy-file policy.yaml" | ||
| log_info "" | ||
| log_info "For more information, visit: https://github.com/$REPO" | ||
| else | ||
| log_error "Installation verification failed" | ||
| exit 1 | ||
| fi | ||
| } | ||
|
|
||
| main "$@" | ||
| else | ||
| # Skip system-wide PATH configuration | ||
| print_warning "Skipping system-wide PATH configuration in /etc/environment" | ||
| print_warning "Consider manually adding '$HOME/.local/bin' to your PATH if needed" | ||
| fi |
There was a problem hiding this comment.
I think this is undesirable for most users because they don't want a script to mess with their system-wide environment PATH. The user should be responsible for any system-wide PATH modifications if they are truly needed.
There was a problem hiding this comment.
I can't disagree with that :) Just fixed it and removed the system-wide changes from the 'installer.sh'
| # - macOS (Intel, Apple Silicon) | ||
| # | ||
| # The binary will be installed to: ~/.local/bin/wassette | ||
| # PATH will be updated in: ~/.bashrc, ~/.zshrc, ~/.profile |
There was a problem hiding this comment.
why adding to all three? Could we only add the path to ~/.profile
There was a problem hiding this comment.
Using only the '.profile' forces the user to 'source ~/.profile' to make the wassette binary available to them in the PATH variable. By using the shell's configuration file it becomes immediately available in a new session that doesn't require a new login event.
I just pushed a change that only updates the .profile when a shell configuration file cannot be found. So, it works like this:
- If you're using bash: It will try to add to ~/.bashrc or ~/.bash_profile
- If you're using zsh: It will try to add to ~/.zshrc
- If you're using another shell: It will only try to add to ~/.profile and prompt you to re-source the profile
There was a problem hiding this comment.
I think at the end of the script that prints "you need to run source ~/.profile" is a good compromise
| # The binary will be installed to: ~/.local/bin/wassette | ||
| # PATH will be updated in: ~/.bashrc, ~/.zshrc, ~/.profile | ||
| # | ||
| ##################################################################### |
There was a problem hiding this comment.
This could be a follow up but ideally this script should check if wassette is already installed and if its version matches the latest release before downloading
There was a problem hiding this comment.
Good call out, this will need to be added when we create installer packages for brew and winget.
…shell path Signed-off-by: Josh Duffney <jduffney@microsoft.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…k from copilot suggestion Signed-off-by: Josh Duffney <jduffney@microsoft.com>
Signed-off-by: Josh Duffney <jduffney@microsoft.com>
…nges are necessary Signed-off-by: Josh Duffney <jduffney@microsoft.com>
Signed-off-by: Josh Duffney <jduffney@microsoft.com>
4ef48ab to
f920554
Compare
This pull request updates the release workflow in
.github/workflows/release.ymland 'install.sh' to improve artifact naming consistency, include version information in artifact names, and enhance the release process. Key changes include adding architecture and version details to artifact names, extracting the version dynamically, and updating download links in the release notes.Shell Path reloading
Download URL
Artifact naming improvements:
arch) and version information, ensuring consistency across all platforms (e.g.,wassette_${{ steps.version.outputs.version }}_${{ matrix.arch }}).Version extraction:
github.ref_name) and store it in theGITHUB_OUTPUT, enabling dynamic versioning in artifact names.Release notes updates: