#85 add script for manually publish release for M1 and M2

This commit is contained in:
neil 2022-12-14 15:48:26 +08:00
parent 8dfa2c5e1e
commit e421b32fef
3 changed files with 43 additions and 0 deletions

36
.github/update-latest-binary.sh vendored Executable file
View file

@ -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

View file

@ -37,6 +37,12 @@ Lets follow the [semver](https://semver.org/) versioning standard, prefixed with
$ git tag v1.0.0 $ git tag v1.0.0
$ git push <remote> tag v1.0.0 $ git push <remote> 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: Refer to each package README.md for instructions on how to setup and contribue to them:

View file

@ -3,6 +3,7 @@
"author": "neil molina <neil@tea.xyz>", "author": "neil molina <neil@tea.xyz>",
"private": true, "private": true,
"scripts": { "scripts": {
"release": "sh ./.github/update-latest-binary.sh",
"build:gui": "pnpm --filter gui exec tauri build", "build:gui": "pnpm --filter gui exec tauri build",
"dev:gui": "pnpm --filter gui exec tauri dev", "dev:gui": "pnpm --filter gui exec tauri dev",
"web:gui": "BUILD_FOR=preview pnpm --filter gui dev" "web:gui": "BUILD_FOR=preview pnpm --filter gui dev"