-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add Desktop release for macOS, Windows & Linux #130
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haven't had a chance to actually try the build yet but there are a few things we need to fix first.
I'll provide the remaining assets (icons, "loading.html", etc) later.
Co-authored-by: Fernando Maclen <fmaclen@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ended up making some of the changes myself, I spent several hours trying to simplify the workflow and it was a lot easier to just commit my changes directly, so I left you some notes on what changes I made and why.
So far, I only tested the dev and packaged builds on macOS and it works fine.
Next, I will do some QA on the Windows & Linux releases.
After that, I will QA the Github Action in a separate repo to make sure it's all running smoothly.
Tried building a `deb` release but it turned out to be a pain due to x86/arm64 architecture issues
this is so it's easier to identify logging statements from Hollama vs other libraries
…ollama into 64-add-desktop-release
function checkServerAvailability(port) { | ||
const MAX_RETRIES = 10; | ||
const RETRY_INTERVAL_IN_MS = 1000; | ||
|
||
return new Promise((resolve, reject) => { | ||
let retries = 0; | ||
|
||
function tryConnection() { | ||
const socket = new net.Socket(); | ||
|
||
const onError = () => { | ||
socket.destroy(); | ||
|
||
if (retries >= MAX_RETRIES) { | ||
reject(new Error(`Couldn't connect to Hollama server after ${MAX_RETRIES} attempts`)); | ||
} else { | ||
retries++; | ||
setTimeout(tryConnection, RETRY_INTERVAL_IN_MS); | ||
} | ||
}; | ||
|
||
socket.setTimeout(1000); | ||
socket.once('error', onError); | ||
socket.once('timeout', onError); | ||
|
||
socket.connect(port, HOLLAMA_HOST, () => { | ||
socket.destroy(); | ||
resolve(); | ||
}); | ||
} | ||
|
||
tryConnection(); | ||
}); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use this function to check if the server is ready once per second, up-to 10 times.
🎉 This PR is included in version 0.8.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Closes #64