Skip to content

Commit

Permalink
Use GitHub to host desktop client releases
Browse files Browse the repository at this point in the history
  • Loading branch information
c2d7fa committed Jun 26, 2022
2 parents 9045a58 + 5f8c581 commit 64e95b3
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 40 deletions.
33 changes: 16 additions & 17 deletions .github/workflows/deploy-desktop.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
name: Build and deploy desktop clients
on:
push:
branches:
- main
tags:
- '[0-9]+.[0-9]+.[0-9]+'
jobs:
prepare-release:
runs-on: ubuntu-latest
steps:
- name: Create release
uses: softprops/action-gh-release@v1
desktop-linux:
runs-on: ubuntu-latest
steps:
Expand All @@ -20,13 +25,10 @@ jobs:
yarn run bundle-linux
env:
DIAFORM_API_HOST: ${{secrets.api_host}}
- name: Deploy to Azure Storage
run: |
cd src/desktop
az storage blob upload -f "./dist/Thinktool Desktop Prototype.AppImage" -c '$web' -o table
env:
AZURE_STORAGE_ACCOUNT: ${{secrets.azure_storage_account}}
AZURE_STORAGE_KEY: ${{secrets.azure_storage_key}}
- name: Create release
uses: softprops/action-gh-release@v1
with:
files: 'src/desktop/dist/Thinktool*.AppImage'
desktop-windows:
runs-on: windows-2019
steps:
Expand All @@ -44,11 +46,8 @@ jobs:
shell: bash
env:
DIAFORM_API_HOST: ${{secrets.api_host}}
- name: Deploy to Azure Storage
run: |
cd src/desktop
az storage blob upload -f "./dist/Thinktool Desktop Prototype.exe" -c '$web' -o table
shell: bash
env:
AZURE_STORAGE_ACCOUNT: ${{secrets.azure_storage_account}}
AZURE_STORAGE_KEY: ${{secrets.azure_storage_key}}
- name: Create release
uses: softprops/action-gh-release@v1
with:
files: 'src/desktop/dist/Thinktool*.exe'

13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,15 @@ page.
### Releasing new client version

When you are ready to push out a client-side update, run
`tools/dev/release-client.sh <version>`. This will bump the version number to
`<version>`, publish the package, and also update the relevant dependency in
`tools/dev/release-client.sh <client-version>`. This will bump the version number to
`<client-version>`, publish the package, and also update the relevant dependency in
the web and desktop clients.

Then commit the changes, push to origin, and in the GitHub repository, run the
action titled "Deploy to Azure Storage".
Manually update the version number in the `package.json` for the `desktop`
package, commit the changes, tag the commit with a tag of the form `x.y.z` and
push to GitHub. A workflow should automatically create a GitHub release; manually
update this release with the release notes.

Note that the tag should be the same as the desktop client version, while the
version number for the client package may be different!

10 changes: 5 additions & 5 deletions src/desktop/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@thinktool/desktop",
"version": "0.0.0-noversion",
"version": "1.0.0",
"description": "The desktop client for Thinktool.",
"license": "UNLICENSED",
"repository": {
Expand Down Expand Up @@ -28,13 +28,13 @@
"build-static": "./build-static-and-client-for-desktop.sh",
"build": "mkdir -p build && tsc && yarn run build-static",
"start": "electron-builder --dir && ./dist/linux-unpacked/thinktool-desktop-client",
"bundle-linux": "yarn run build && electron-builder -l -p never && mv 'dist/Thinktool Desktop Prototype-0.0.0-noversion.AppImage' 'dist/Thinktool Desktop Prototype.AppImage' && echo 'Output in ./dist/'",
"bundle-windows": "yarn run build && electron-builder -w -p never && mv 'dist/Thinktool Desktop Prototype 0.0.0-noversion.exe' 'dist/Thinktool Desktop Prototype.exe' && echo 'Output in ./dist/'"
"bundle-linux": "yarn run build && electron-builder -l -p never && echo 'Output in ./dist/'",
"bundle-windows": "yarn run build && electron-builder -w -p never && echo 'Output in ./dist/'"
},
"main": "build/start.js",
"build": {
"appId": "io.thinktool.desktop.prototype",
"productName": "Thinktool Desktop Prototype",
"appId": "io.thinktool.desktop",
"productName": "Thinktool",
"files": [
"build/**/*"
],
Expand Down
29 changes: 15 additions & 14 deletions src/web/pages/download.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export async function getStaticProps() {
};
}

function Timestamp(props: {date: Date}) {
function Timestamp(props: { date: Date }) {
const year = props.date.getUTCFullYear().toString();
const monthName = [
"January",
Expand All @@ -38,7 +38,7 @@ function Timestamp(props: {date: Date}) {
);
}

export default function Download(props: {apiHost: string; assetsHost: string; generatedTime: number}) {
export default function Download(props: { apiHost: string; assetsHost: string; generatedTime: number }) {
return (
<StaticPage>
<Head>
Expand Down Expand Up @@ -73,24 +73,25 @@ export default function Download(props: {apiHost: string; assetsHost: string; ge

<div className="block box small centered">
<p>
The current version is a <strong>pre-prototype intended purely for testing</strong>. If you use this,
you may lose your data. It is not currently possible to synchronize your data in the desktop client to
the online version, and it may never be (from the current version, that is)!
The current version is a <strong>prototype intended purely for testing</strong>. If you use this, you
may lose your data. It is not currently possible to synchronize your data in the desktop client to the
online version, and it may never be (from the current version, that is)!
</p>
<p>
Get it for <strong>Linux</strong> here:{" "}
<a href={`${props.assetsHost}/Thinktool Desktop Prototype.AppImage`} download className="external-link">
<span>Thinktool Desktop Prototype.AppImage</span>
Download it for Linux or Windows from GitHub:{" "}
<a href={`https://github.com/c2d7fa/thinktool/releases/latest`} download className="external-link">
<span>Latest release</span>
</a>
. Just make it executable with <code>chmod +x &lt;FILENAME&gt;</code> and then run it.
</p>
<p>
Get it for <strong>Windows</strong> here:{" "}
<a href={`${props.assetsHost}/Thinktool Desktop Prototype.exe`} download className="external-link">
<span>Thinktool Desktop Prototype .exe</span>
</a>
. This is a so-called portable executable, so you don't need to install anything &ndash; just run it.
For <strong>Linux</strong>, just make the downloaded AppImage executable with{" "}
<code>chmod +x &lt;FILENAME&gt;</code> and then run it.
</p>
<p>
The <strong>Windows</strong> version is a so-called portable executable, so you don't need to install
anything &ndash; just run it.
</p>
<p>Currently, no macOS version is available</p>
<p>
<i>
Last updated <Timestamp date={new Date(props.generatedTime)} />.
Expand Down

1 comment on commit 64e95b3

@vercel
Copy link

@vercel vercel bot commented on 64e95b3 Jun 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

thinktool – ./

thinktool-git-website-johv.vercel.app
thinktool.vercel.app
thinktool-johv.vercel.app
thinktool.io

Please sign in to comment.