From e421b32feffecac684fcc5052b55254f88c5026d Mon Sep 17 00:00:00 2001 From: neil Date: Wed, 14 Dec 2022 15:48:26 +0800 Subject: [PATCH] #85 add script for manually publish release for M1 and M2 --- .github/update-latest-binary.sh | 36 +++++++++++++++++++++++++++++++++ README.md | 6 ++++++ package.json | 1 + 3 files changed, 43 insertions(+) create mode 100755 .github/update-latest-binary.sh diff --git a/.github/update-latest-binary.sh b/.github/update-latest-binary.sh new file mode 100755 index 0000000..46b7be6 --- /dev/null +++ b/.github/update-latest-binary.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +git fetch +git checkout main + + +ARM_CPU="" +IS_M1=$(sysctl -a | grep "Apple M1") +IS_M2=$(sysctl -a | grep "Apple M2") + +if [ -z "$IS_M1" ] +then + if [ -z "$IS_M2" ] + then + echo "not valid" + else + ARM_CPU="m2" + fi +else + ARM_CPU="m1" +fi + +if ["$ARM_CPU" == ""] +then + echo "nothing to build" +else + tag=$(git tag -l --sort=-creatordate | head -n 1) + pnpm build:gui -b dmg + + echo "uploading to s3" + build_path="$PWD/packages/gui/src-tauri/target/release/bundle/dmg/gui_0.1.0_aarch64.dmg" + tag_path="s3://preview.gui.tea.xyz/release/tea_gui_$tag.$ARM_CPU.dmg" + latest_path="s3://preview.gui.tea.xyz/release/tea_gui_latest.$ARM_CPU.dmg" + aws s3 cp $build_path $tag_path + aws s3 cp $tag_path $latest_path +fi \ No newline at end of file diff --git a/README.md b/README.md index 6d2a40f..d480520 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,12 @@ Lets follow the [semver](https://semver.org/) versioning standard, prefixed with $ git tag v1.0.0 $ git push tag v1.0.0 ``` +We do not have a runner for building for M1 and M2, to manually deploy a release. Make sure you have a [aws-cli](https://aws.amazon.com/cli/). Configure your aws cli profile correctly. +To publish a release simply run +``` +$ AWS_PROFILE=tea/or/etc pnpm release +``` + Refer to each package README.md for instructions on how to setup and contribue to them: diff --git a/package.json b/package.json index a5fcd29..9622432 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "author": "neil molina ", "private": true, "scripts": { + "release": "sh ./.github/update-latest-binary.sh", "build:gui": "pnpm --filter gui exec tauri build", "dev:gui": "pnpm --filter gui exec tauri dev", "web:gui": "BUILD_FOR=preview pnpm --filter gui dev"