Skip to content
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

Merged
merged 37 commits into from
Aug 6, 2024

Conversation

GregoMac1
Copy link
Collaborator

@GregoMac1 GregoMac1 commented Jul 31, 2024

Closes #64

image
image

@GregoMac1 GregoMac1 self-assigned this Jul 31, 2024
@GregoMac1 GregoMac1 linked an issue Jul 31, 2024 that may be closed by this pull request
Copy link
Owner

@fmaclen fmaclen left a 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.

.github/workflows/publish.yml Outdated Show resolved Hide resolved
electron/main.js Outdated Show resolved Hide resolved
electron/main.js Outdated Show resolved Hide resolved
electron/main.js Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
electron/main.js Outdated Show resolved Hide resolved
svelte.config.js Outdated Show resolved Hide resolved
@GregoMac1 GregoMac1 marked this pull request as ready for review August 3, 2024 21:48
@GregoMac1 GregoMac1 requested a review from fmaclen August 3, 2024 21:48
@fmaclen fmaclen changed the title add electron config feat: add Desktop release for macOS, Windows & Linux Aug 4, 2024
Copy link
Owner

@fmaclen fmaclen left a 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.

.github/workflows/publish.yml Show resolved Hide resolved
.github/workflows/publish.yml Outdated Show resolved Hide resolved
electron/main.js Outdated Show resolved Hide resolved
electron/main.js Outdated Show resolved Hide resolved
electron/main.js Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
electron/main.js Outdated Show resolved Hide resolved
electron/main.js Outdated Show resolved Hide resolved
Comment on lines +21 to +54
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();
});
}
Copy link
Owner

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.

@fmaclen fmaclen merged commit 244d425 into main Aug 6, 2024
2 checks passed
@fmaclen fmaclen deleted the 64-add-desktop-release branch August 6, 2024 17:00
@fmaclen
Copy link
Owner

fmaclen commented Aug 6, 2024

🎉 This PR is included in version 0.8.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add desktop release
2 participants