Forgejo Auto-Update
Inspired by go-github-selfupdate, adapted for Forgejo instances.
Installation
go get https://codeberg.org/ChakSoft/forgejo-autoupdate
Usage
package main
import (
"fmt"
"codeberg.org/ChakSoft/forgejo-autoupdate"
)
func main() {
updater := autoupdate.NewUpdater("v0.1.0", "codeberg.org", "myaccount", "myrepository", false)
available, latest := updater.HasUpdateAvailable()
if available {
updatePath, currentExe, err := updater.DownloadUpdate()
if err != nil {
panic(err)
}
fmt.Printf("update binary is stored at: %s\n", updatePath)
}
}
This example will download the update and stores it in the temporary folder of your system.
License
This software is distributed as-is, under GNU GPL v3 License.