Retrieve the latest version and use it to detect upstream