Fix nightly auto-update failure due to version parsing error (#3548)
After https://github.com/zed-industries/zed/pull/3507, parsing the app's semver version from the application plist stopped working, which caused auto-updates to stop. I don't think we need to put `-nightly` in the version number: it's already in the release channel name, which is reported alongside the version in most cases. For example, the 'About' dialog was saying `Zed Nightly 2.0.0-nightly`. I think even without nightly, it would be a good idea to include the *release channel* name in the datadog alerts that show up in slack. @JosephTLyons could you look into how to do that? /cc @SomeoneToIgnore
This commit is contained in:
commit
89f62a1a69
2 changed files with 9 additions and 12 deletions
3
.github/workflows/release_nightly.yml
vendored
3
.github/workflows/release_nightly.yml
vendored
|
@ -81,12 +81,11 @@ jobs:
|
||||||
- name: Limit target directory size
|
- name: Limit target directory size
|
||||||
run: script/clear-target-dir-if-larger-than 100
|
run: script/clear-target-dir-if-larger-than 100
|
||||||
|
|
||||||
- name: Set release channel to nightly, add nightly prefix to the final version
|
- name: Set release channel to nightly
|
||||||
run: |
|
run: |
|
||||||
set -eu
|
set -eu
|
||||||
version=$(git rev-parse --short HEAD)
|
version=$(git rev-parse --short HEAD)
|
||||||
echo "Publishing version: ${version} on release channel nightly"
|
echo "Publishing version: ${version} on release channel nightly"
|
||||||
sed -i '' "s/version = \"\(.*\)\"/version = \"\1-nightly\"/" crates/zed2/Cargo.toml
|
|
||||||
echo "nightly" > crates/zed/RELEASE_CHANNEL
|
echo "nightly" > crates/zed/RELEASE_CHANNEL
|
||||||
|
|
||||||
- name: Generate license file
|
- name: Generate license file
|
||||||
|
|
|
@ -85,15 +85,7 @@ pub fn init(http_client: Arc<dyn HttpClient>, server_url: String, cx: &mut AppCo
|
||||||
AutoUpdateSetting::register(cx);
|
AutoUpdateSetting::register(cx);
|
||||||
|
|
||||||
cx.observe_new_views(|workspace: &mut Workspace, _cx| {
|
cx.observe_new_views(|workspace: &mut Workspace, _cx| {
|
||||||
workspace
|
workspace.register_action(|_, action: &Check, cx| check(action, cx));
|
||||||
.register_action(|_, action: &Check, cx| check(action, cx))
|
|
||||||
.register_action(|_, _action: &CheckThatAutoUpdaterWorks, cx| {
|
|
||||||
let prompt = cx.prompt(gpui::PromptLevel::Info, "It does!", &["Ok"]);
|
|
||||||
cx.spawn(|_, _cx| async move {
|
|
||||||
prompt.await.ok();
|
|
||||||
})
|
|
||||||
.detach();
|
|
||||||
});
|
|
||||||
|
|
||||||
// @nate - code to trigger update notification on launch
|
// @nate - code to trigger update notification on launch
|
||||||
// workspace.show_notification(0, _cx, |cx| {
|
// workspace.show_notification(0, _cx, |cx| {
|
||||||
|
@ -130,9 +122,15 @@ pub fn init(http_client: Arc<dyn HttpClient>, server_url: String, cx: &mut AppCo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn check(_: &Check, cx: &mut AppContext) {
|
pub fn check(_: &Check, cx: &mut ViewContext<Workspace>) {
|
||||||
if let Some(updater) = AutoUpdater::get(cx) {
|
if let Some(updater) = AutoUpdater::get(cx) {
|
||||||
updater.update(cx, |updater, cx| updater.poll(cx));
|
updater.update(cx, |updater, cx| updater.poll(cx));
|
||||||
|
} else {
|
||||||
|
drop(cx.prompt(
|
||||||
|
gpui::PromptLevel::Info,
|
||||||
|
"Auto-updates disabled for non-bundled app.",
|
||||||
|
&["Ok"],
|
||||||
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue