21
loading...
This website collects cookies to deliver better user experience
I'm aware many of you have no idea what makes this project useful because High School Debate tech isn't exactly commonplace in dev circles. Luckily that's not the point of this post. When deploying Cut-It, I had to go through several hurdles and frankly, if I were rebuilding this project from scratch, I would do it completely differently. My advice should apply to anyone, so that's the point of this writeup.
--onefile
option with PyInstaller, it took me almost 20 seconds to run the program. On start:
1. Poll the GitHub releases page (using the GitHub API) for the latest release
- If the latest release version == the current software version, ignore the rest of these steps and load directly to the program
2. In the release description, check for a throwaway tag marked '<req>' signaling that the update is required
- If the update is required, don't offer a 'Continue without Updating' option
3. Find out what platform the code is running on
4. In the 'assets' section of the release on GitHub, find the target installer (Windows: dist-win.msi, MacOS: dist-mac.pkg).
5. Set the 'Update Now' button to open the 'browser_download_url' of the appropriate installer
https://api.github.com/repos/{USERNAME}/{REPO_NAME}/releases
. [
{
"url": "https://api.github.com/repos/http-samc/cut-it/releases/44302713",
"node_id": "MDc6UmVsZWFzZTQ0MzAyNzEz",
"tag_name": "v.1.0@Release",
"target_commitish": "main",
"name": "Cut-It Release Version 1.0",
"created_at": "2021-06-08T19:23:24Z",
"published_at": "2021-06-08T19:35:56Z",
"assets": [
{
"url": "https://api.github.com/repos/http-samc/cut-it/releases/assets/40352177",
"id": 40352177,
"name": "dist-mac.pkg",
"content_type": "application/octet-stream",
"download_count": 35,
"created_at": "2021-07-15T11:32:26Z",
"updated_at": "2021-07-15T11:34:02Z",
"browser_download_url": "https://github.com/http-samc/cut-it/releases/download/v.1.0%40Release/dist-mac.pkg"
},
{
"url": "https://api.github.com/repos/http-samc/cut-it/releases/assets/40350931",
"id": 40350931,
"name": "dist-win.msi",
"download_count": 40,
"created_at": "2021-07-15T11:17:55Z",
"updated_at": "2021-07-15T11:19:59Z",
"browser_download_url": "https://github.com/http-samc/cut-it/releases/download/v.1.0%40Release/dist-win.msi"
}
],
"tarball_url": "https://api.github.com/repos/http-samc/cut-it/tarball/v.1.0@Release",
"zipball_url": "https://api.github.com/repos/http-samc/cut-it/zipball/v.1.0@Release",
"body": "<req> ... {omitted for brevity}",
},
...
]
window.getSelection()
?".