Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/marianozunino/selfupdater
Eliminate copy-paste self-update logic across personal CLI projects. Designed for GoReleaser-based release workflows.
https://github.com/marianozunino/selfupdater
Last synced: about 6 hours ago
JSON representation
Eliminate copy-paste self-update logic across personal CLI projects. Designed for GoReleaser-based release workflows.
- Host: GitHub
- URL: https://github.com/marianozunino/selfupdater
- Owner: marianozunino
- License: mit
- Created: 2024-11-22T14:34:40.000Z (about 2 months ago)
- Default Branch: master
- Last Pushed: 2025-01-06T14:36:05.000Z (10 days ago)
- Last Synced: 2025-01-06T15:41:39.153Z (10 days ago)
- Language: Go
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SelfUpdater
## Motivation
Eliminate copy-paste self-update logic across personal CLI projects. Designed for GoReleaser-based release workflows.## Features
- Automatic version checking against GitHub releases
- Platform-specific asset selection
- Checksum verification
- Safe binary update with rollback support## Installation
```bash
go get github.com/marianozunino/selfupdater
```## Usage
```go
package mainimport selfupdater "github.com/marianozunino/selfupdater/pkg/selfupdater"
func main() {
// Create an updater instance
updater := selfupdater.NewUpdater(
"your-github-username", // GitHub owner
"your-repo-name", // Repository name
"your-binary-name", // Binary name (matching GoReleaser config)
"current-version" // Current version of your application
)// Perform update check and apply if needed
updater.Update()
}
```### Optional Authentication
If you're using a private repository or need higher API rate limits:
```go
updater := selfupdater.NewUpdater(
"owner",
"repo",
"binary",
"version",
selfupdater.WithToken("your-github-token")
)
```## License
MIT License