mirror of
https://github.com/ivabus/gui
synced 2025-06-07 15:50:27 +03:00
commit
e6bf74cd71
3 changed files with 255 additions and 126 deletions
245
.github/workflows/ci.yml
vendored
245
.github/workflows/ci.yml
vendored
|
@ -1,7 +1,6 @@
|
||||||
name: "test"
|
name: "test"
|
||||||
on: [pull_request]
|
on: [pull_request]
|
||||||
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
changes:
|
changes:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
@ -108,112 +107,178 @@ jobs:
|
||||||
platform:
|
platform:
|
||||||
- os: macos-11
|
- os: macos-11
|
||||||
name: darwin+x86-64
|
name: darwin+x86-64
|
||||||
id: mac_latest
|
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
name: linux+x86-64
|
name: linux+x86-64
|
||||||
id: linux
|
|
||||||
- os: [self-hosted, macOS, ARM64]
|
- os: [self-hosted, macOS, ARM64]
|
||||||
name: darwin+aarch64
|
name: darwin+aarch64
|
||||||
id: mac_m1
|
|
||||||
# err: Package atk was not found in the pkg-config search path.
|
# err: Package atk was not found in the pkg-config search path.
|
||||||
# requires atk >= 2.18
|
# requires atk >= 2.18
|
||||||
# - os: [self-hosted, linux, ARM64]
|
# - os: [self-hosted, linux, ARM64]
|
||||||
# name: linux+aarch64
|
# name: linux+aarch64
|
||||||
container: ${{ matrix.platform.container }}
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
- uses: teaxyz/setup@v0
|
||||||
|
if: startsWith(matrix.platform.name, 'darwin')
|
||||||
|
|
||||||
- name: build tauri for MacOS
|
- name: build tauri for MacOS
|
||||||
# uses: teaxyz/setup@v0
|
if: startsWith(matrix.platform.name, 'darwin')
|
||||||
if: startsWith(matrix.platform.name, 'darwin')
|
# FROM: https://tauri.app/v1/guides/distribution/sign-macos
|
||||||
# FROM: https://tauri.app/v1/guides/distribution/sign-macos
|
env:
|
||||||
env:
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
ENABLE_CODE_SIGNING: ${{ secrets.GUI_APPLE_CERTIFICATE }}
|
||||||
ENABLE_CODE_SIGNING: ${{ secrets.GUI_APPLE_CERTIFICATE }}
|
APPLE_CERTIFICATE: ${{ secrets.GUI_APPLE_CERTIFICATE }}
|
||||||
APPLE_CERTIFICATE: ${{ secrets.GUI_APPLE_CERTIFICATE }}
|
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.GUI_APPLE_CERTIFICATE_PASSWORD }}
|
||||||
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.GUI_APPLE_CERTIFICATE_PASSWORD }}
|
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
|
||||||
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
|
run: tea -ES xc build
|
||||||
# TODO: uncomment once isolated m1 runner is setup with latest xcode
|
|
||||||
# only used for notarization
|
|
||||||
# APPLE_ID: ${{ secrets.APPLE_ID }}
|
|
||||||
# APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
|
|
||||||
run: |
|
|
||||||
sh <(curl https://tea.xyz) -ES xc build
|
|
||||||
|
|
||||||
- name: build tauri for Linux
|
- name: build tauri for Linux
|
||||||
# uses: teaxyz/setup@v0
|
if: startsWith(matrix.platform.name, 'linux')
|
||||||
if: startsWith(matrix.platform.name, 'linux')
|
# TODO: https://tauri.app/v1/guides/distribution/sign-linux
|
||||||
# TODO: https://tauri.app/v1/guides/distribution/sign-linux
|
uses: docker://getneil/tea-builder:latest
|
||||||
uses: docker://getneil/tea-builder:latest
|
|
||||||
|
|
||||||
- name: build platform output
|
- run: tar -czvf artifacts.tgz -C ./modules/gui/src-tauri/target/release/bundle .
|
||||||
id: build_platform
|
|
||||||
env:
|
|
||||||
platform: ${{ matrix.platform.name }}
|
|
||||||
run: |
|
|
||||||
EXTENSION=dmg
|
|
||||||
BUILD_PLATFORM=$(echo $platform | sed -e "s/darwin+//g" | sed -e "s/linux+//g")
|
|
||||||
[[ $BUILD_PLATFORM = "x86-64" ]] && BUILD_PLATFORM="x64" || BUILD_PLATFORM=$BUILD_PLATFORM
|
|
||||||
[[ $platform = "linux+x86-64" ]] && BUILD_PLATFORM="amd64" || BUILD_PLATFORM=$BUILD_PLATFORM
|
|
||||||
[[ $platform = "linux+x86-64" ]] && EXTENSION="deb"
|
|
||||||
echo "build_platform=$BUILD_PLATFORM" >> $GITHUB_OUTPUT
|
|
||||||
echo "extension=$EXTENSION" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: zip .app for MacOS
|
- name: upload artifacts
|
||||||
if: matrix.platform.name == 'darwin+x86-64' || matrix.platform.name == 'darwin+aarch64'
|
uses: actions/upload-artifact@v3
|
||||||
run: |
|
with:
|
||||||
cd ./modules/gui/src-tauri/target/release/bundle/macos/ && zip -r tea.zip tea.app
|
name: ${{ matrix.platform.name }}
|
||||||
|
path: artifacts.tgz
|
||||||
|
if-no-files-found: error
|
||||||
|
|
||||||
- uses: aws-actions/configure-aws-credentials@v1
|
notorize_tauri:
|
||||||
with:
|
needs: [build_tauri]
|
||||||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
runs-on: macos-11
|
||||||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
strategy:
|
||||||
aws-region: us-east-1
|
matrix:
|
||||||
|
platform:
|
||||||
|
- darwin+x86-64
|
||||||
|
- darwin+aarch64
|
||||||
|
steps:
|
||||||
|
- uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: ${{ matrix.platform }}
|
||||||
|
|
||||||
- name: cp package images from prod to preview bucket
|
- run: tar xzf artifacts.tgz
|
||||||
env:
|
|
||||||
prefix: ${{ needs.changes.outputs.preview_folder }}
|
|
||||||
platform: ${{ steps.build_platform.outputs.build_platform }}
|
|
||||||
extension: ${{ steps.build_platform.outputs.extension }}
|
|
||||||
run: |
|
|
||||||
aws s3 cp "./modules/gui/src-tauri/target/release/bundle/$extension/tea_0.1.0_$platform.$extension" \
|
|
||||||
"s3://preview.gui.tea.xyz/$prefix/tea_$platform.$extension"
|
|
||||||
|
|
||||||
- name: cp package zip for MacOS
|
- run: cd ./macos/ && zip -r tea.zip tea.app
|
||||||
if: matrix.platform.name == 'darwin+x86-64' || matrix.platform.name == 'darwin+aarch64'
|
|
||||||
env:
|
|
||||||
prefix: ${{ needs.changes.outputs.preview_folder }}
|
|
||||||
platform: ${{ steps.build_platform.outputs.build_platform }}
|
|
||||||
run: |
|
|
||||||
aws s3 cp ./modules/gui/src-tauri/target/release/bundle/macos/tea.zip "s3://preview.gui.tea.xyz/$prefix/tea_$platform.zip"
|
|
||||||
|
|
||||||
- name: comment install for Linux
|
# Notarize. Can take up to 10 minutes (and fail) asynchronously
|
||||||
if: startsWith(matrix.platform.name, 'linux')
|
- run: xcrun altool --notarize-app --username "$APPLE_ID" --password "$APPLE_PASSWORD" --primary-bundle-id "com.tea.xyz" --file ./macos/tea.zip
|
||||||
uses: mshick/add-pr-comment@v2
|
env:
|
||||||
with:
|
APPLE_ID: ${{ secrets.APPLE_ID }}
|
||||||
message-id: ${{ matrix.platform.id }}-comment
|
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
|
||||||
message: |
|
|
||||||
**installer for Linux ${{ matrix.platform.name }} is at**:
|
|
||||||
<a href="http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/${{ needs.changes.outputs.preview_folder }}/tea_${{steps.build_platform.outputs.build_platform}}.${{steps.build_platform.outputs.extension}}" target="_blank">here</a>
|
|
||||||
|
|
||||||
```bash
|
upload:
|
||||||
http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/${{ needs.changes.outputs.preview_folder }}/tea_${{ steps.build_platform.outputs.build_platform }}.${{ steps.build_platform.outputs.extension }}
|
needs: [build_tauri, notorize_tauri]
|
||||||
```
|
runs-on: ubuntu-latest
|
||||||
copy-paste into a browser to download
|
strategy:
|
||||||
|
matrix:
|
||||||
|
platform:
|
||||||
|
- name: darwin+x86-64
|
||||||
|
id: mac_latest
|
||||||
|
- name: linux+x86-64
|
||||||
|
id: linux
|
||||||
|
- name: darwin+aarch64
|
||||||
|
id: mac_m1
|
||||||
|
# - name: linux+aarch64
|
||||||
|
# id: linux_arm64
|
||||||
|
steps:
|
||||||
|
- uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: ${{ matrix.platform.name }}
|
||||||
|
|
||||||
- name: comment install for MacOS
|
- run: tar xzf artifacts.tgz
|
||||||
if: startsWith(matrix.platform.name, 'darwin')
|
|
||||||
uses: mshick/add-pr-comment@v2
|
|
||||||
with:
|
|
||||||
message-id: ${{ matrix.platform.id }}-comment
|
|
||||||
message: |
|
|
||||||
**installers for MacOS ${{ matrix.platform.name }} is at**:
|
|
||||||
<a href="http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/${{ needs.changes.outputs.preview_folder }}/tea_${{steps.build_platform.outputs.build_platform}}.zip" target="_blank">.zip</a>
|
|
||||||
or
|
|
||||||
<a href="http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/${{ needs.changes.outputs.preview_folder }}/tea_${{steps.build_platform.outputs.build_platform}}.dmg" target="_blank">.dmg</a>
|
|
||||||
|
|
||||||
```bash
|
- name: build platform output
|
||||||
http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/${{ needs.changes.outputs.preview_folder }}/tea_${{ steps.build_platform.outputs.build_platform }}.zip
|
id: build_platform
|
||||||
http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/${{ needs.changes.outputs.preview_folder }}/tea_${{ steps.build_platform.outputs.build_platform }}.dmg
|
env:
|
||||||
```
|
platform: ${{ matrix.platform.name }}
|
||||||
copy-paste into a browser to download
|
run: |
|
||||||
|
BUILD_PLATFORM=$(echo $platform | sed -e "s/darwin+//g" | sed -e "s/linux+//g")
|
||||||
|
EXTENSION=dmg
|
||||||
|
case $platform in
|
||||||
|
"linux+x86-64")
|
||||||
|
BUILD_PLATFORM="amd64"
|
||||||
|
EXTENSION="deb"
|
||||||
|
;;
|
||||||
|
"linux+aarch64")
|
||||||
|
BUILD_PLATFORM="aarch64"
|
||||||
|
EXTENSION="deb"
|
||||||
|
;;
|
||||||
|
"darwin+aarch64")
|
||||||
|
BUILD_PLATFORM="aarch64"
|
||||||
|
EXTENSION="dmg"
|
||||||
|
;;
|
||||||
|
"darwin+x86-64")
|
||||||
|
BUILD_PLATFORM="x64"
|
||||||
|
EXTENSION="dmg"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Unknown platform $platform"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
echo "build_platform=$BUILD_PLATFORM" >> $GITHUB_OUTPUT
|
||||||
|
echo "extension=$EXTENSION" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: zip .app for MacOS
|
||||||
|
if: startsWith(matrix.platform.name, 'darwin+')
|
||||||
|
run: |
|
||||||
|
cd ./macos/
|
||||||
|
zip -r tea.zip tea.app
|
||||||
|
|
||||||
|
- uses: aws-actions/configure-aws-credentials@v1
|
||||||
|
with:
|
||||||
|
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||||
|
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
|
aws-region: us-east-1
|
||||||
|
|
||||||
|
- name: cp package images from prod to preview bucket
|
||||||
|
env:
|
||||||
|
prefix: ${{ needs.changes.outputs.preview_folder }}
|
||||||
|
platform: ${{ steps.build_platform.outputs.build_platform }}
|
||||||
|
extension: ${{ steps.build_platform.outputs.extension }}
|
||||||
|
run: |
|
||||||
|
aws s3 cp \
|
||||||
|
"./$extension/tea_0.1.0_$platform.$extension" \
|
||||||
|
"s3://preview.gui.tea.xyz/$prefix/tea_$platform.$extension"
|
||||||
|
|
||||||
|
- name: cp package zip for MacOS
|
||||||
|
if: startsWith(matrix.platform.name, 'darwin')
|
||||||
|
env:
|
||||||
|
prefix: ${{ needs.changes.outputs.preview_folder }}
|
||||||
|
platform: ${{ steps.build_platform.outputs.build_platform }}
|
||||||
|
run: |
|
||||||
|
aws s3 cp \
|
||||||
|
./macos/tea.zip "s3://preview.gui.tea.xyz/$prefix/tea_$platform.zip"
|
||||||
|
|
||||||
|
- name: comment install for Linux
|
||||||
|
if: startsWith(matrix.platform.name, 'linux')
|
||||||
|
uses: mshick/add-pr-comment@v2
|
||||||
|
with:
|
||||||
|
message-id: ${{ matrix.platform.id }}-comment
|
||||||
|
message: |
|
||||||
|
**installer for Linux ${{ matrix.platform.name }} is at**:
|
||||||
|
<a href="http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/${{ needs.changes.outputs.preview_folder }}/tea_${{steps.build_platform.outputs.build_platform}}.${{steps.build_platform.outputs.extension}}" target="_blank">here</a>
|
||||||
|
|
||||||
|
```bash
|
||||||
|
http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/${{ needs.changes.outputs.preview_folder }}/tea_${{ steps.build_platform.outputs.build_platform }}.${{ steps.build_platform.outputs.extension }}
|
||||||
|
```
|
||||||
|
copy-paste into a browser to download
|
||||||
|
|
||||||
|
- name: comment install for MacOS
|
||||||
|
if: startsWith(matrix.platform.name, 'darwin')
|
||||||
|
uses: mshick/add-pr-comment@v2
|
||||||
|
with:
|
||||||
|
message-id: ${{ matrix.platform.id }}-comment
|
||||||
|
message: |
|
||||||
|
**installers for MacOS ${{ matrix.platform.name }} is at**:
|
||||||
|
<a href="http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/${{ needs.changes.outputs.preview_folder }}/tea_${{steps.build_platform.outputs.build_platform}}.zip" target="_blank">.zip</a>
|
||||||
|
or
|
||||||
|
<a href="http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/${{ needs.changes.outputs.preview_folder }}/tea_${{steps.build_platform.outputs.build_platform}}.dmg" target="_blank">.dmg</a>
|
||||||
|
|
||||||
|
```bash
|
||||||
|
http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/${{ needs.changes.outputs.preview_folder }}/tea_${{ steps.build_platform.outputs.build_platform }}.zip
|
||||||
|
http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/${{ needs.changes.outputs.preview_folder }}/tea_${{ steps.build_platform.outputs.build_platform }}.dmg
|
||||||
|
```
|
||||||
|
copy-paste into a browser to download
|
114
.github/workflows/main.yml
vendored
114
.github/workflows/main.yml
vendored
|
@ -5,7 +5,6 @@ on:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
changes:
|
changes:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
@ -56,36 +55,79 @@ jobs:
|
||||||
name: darwin+aarch64
|
name: darwin+aarch64
|
||||||
# - os: [self-hosted, linux, ARM64]
|
# - os: [self-hosted, linux, ARM64]
|
||||||
# name: linux+aarch64
|
# name: linux+aarch64
|
||||||
container: ${{ matrix.platform.container }}
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
- uses: teaxyz/setup@v0
|
||||||
|
if: startsWith(matrix.platform.name, 'darwin')
|
||||||
|
|
||||||
- name: build tauri for MacOS
|
- name: build tauri for MacOS
|
||||||
# uses: teaxyz/setup@v0
|
|
||||||
if: startsWith(matrix.platform.name, 'darwin')
|
if: startsWith(matrix.platform.name, 'darwin')
|
||||||
# FROM: https://tauri.app/v1/guides/distribution/sign-macos
|
run: tea -ES xc build
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
ENABLE_CODE_SIGNING: ${{ secrets.GUI_APPLE_CERTIFICATE }}
|
ENABLE_CODE_SIGNING: ${{ secrets.GUI_APPLE_CERTIFICATE }}
|
||||||
APPLE_CERTIFICATE: ${{ secrets.GUI_APPLE_CERTIFICATE }}
|
APPLE_CERTIFICATE: ${{ secrets.GUI_APPLE_CERTIFICATE }}
|
||||||
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.GUI_APPLE_CERTIFICATE_PASSWORD }}
|
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.GUI_APPLE_CERTIFICATE_PASSWORD }}
|
||||||
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
|
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
|
||||||
# todo: uncomment when m1 with latest xcode is deployed
|
|
||||||
# this only helps in notarization
|
|
||||||
# APPLE_ID: ${{ secrets.APPLE_ID }}
|
|
||||||
# APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
|
|
||||||
run: |
|
|
||||||
sh <(curl https://tea.xyz) -ES xc build
|
|
||||||
|
|
||||||
- name: build tauri for Linux
|
- name: build tauri for Linux
|
||||||
# uses: teaxyz/setup@v0
|
|
||||||
if: startsWith(matrix.platform.name, 'linux')
|
if: startsWith(matrix.platform.name, 'linux')
|
||||||
# TODO: https://tauri.app/v1/guides/distribution/sign-linux
|
# TODO: https://tauri.app/v1/guides/distribution/sign-linux
|
||||||
uses: docker://getneil/tea-builder:latest
|
uses: docker://getneil/tea-builder:latest
|
||||||
|
|
||||||
|
- run: tar -czvf artifacts.tgz -C ./modules/gui/src-tauri/target/release/bundle .
|
||||||
|
|
||||||
|
- name: upload artifacts
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: ${{ matrix.platform.name }}
|
||||||
|
path: artifacts.tgz
|
||||||
|
if-no-files-found: error
|
||||||
|
|
||||||
|
notorize_tauri:
|
||||||
|
needs: [build_tauri]
|
||||||
|
runs-on: macos-11
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
platform:
|
||||||
|
- darwin+x86-64
|
||||||
|
- darwin+aarch64
|
||||||
|
steps:
|
||||||
|
- uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: ${{ matrix.platform }}
|
||||||
|
|
||||||
|
- run: tar xzf artifacts.tgz
|
||||||
|
|
||||||
|
- run: cd ./macos/ && zip -r tea.zip tea.app
|
||||||
|
|
||||||
|
# Notarize. Can take up to 10 minutes (and fail) asynchronously
|
||||||
|
- run: xcrun altool --notarize-app --username "$APPLE_ID" --password "$APPLE_PASSWORD" --primary-bundle-id "com.tea.xyz" --file ./macos/tea.zip
|
||||||
|
env:
|
||||||
|
APPLE_ID: ${{ secrets.APPLE_ID }}
|
||||||
|
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
|
||||||
|
|
||||||
|
upload:
|
||||||
|
needs: [build_tauri, notorize_tauri]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
platform:
|
||||||
|
- darwin+x86-64
|
||||||
|
- linux+x86-64
|
||||||
|
- darwin+aarch64
|
||||||
|
# - linux+aarch64
|
||||||
|
steps:
|
||||||
|
- uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: ${{ matrix.platform }}
|
||||||
|
|
||||||
|
- run: tar xzf artifacts.tgz
|
||||||
|
|
||||||
- name: Get current unix ts - seconds
|
- name: Get current unix ts - seconds
|
||||||
id: date
|
id: date
|
||||||
run: echo "unix_seconds=$(date +'%s')" >> $GITHUB_OUTPUT
|
run: echo "unix_seconds=$(date +'%s')" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- uses: aws-actions/configure-aws-credentials@v1
|
- uses: aws-actions/configure-aws-credentials@v1
|
||||||
with:
|
with:
|
||||||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||||
|
@ -95,37 +137,59 @@ jobs:
|
||||||
- name: build platform output
|
- name: build platform output
|
||||||
id: build_platform
|
id: build_platform
|
||||||
env:
|
env:
|
||||||
platform: ${{ matrix.platform.name }}
|
platform: ${{ matrix.platform }}
|
||||||
run: |
|
run: |
|
||||||
BUILD_PLATFORM=$(echo $platform | sed -e "s/darwin+//g" | sed -e "s/linux+//g")
|
BUILD_PLATFORM=$(echo $platform | sed -e "s/darwin+//g" | sed -e "s/linux+//g")
|
||||||
EXTENSION=dmg
|
EXTENSION=dmg
|
||||||
[[ $BUILD_PLATFORM = "x86-64" ]] && BUILD_PLATFORM="x64" || BUILD_PLATFORM=$BUILD_PLATFORM
|
case $platform in
|
||||||
[[ $platform = "linux+x86-64" ]] && BUILD_PLATFORM="amd64" || BUILD_PLATFORM=$BUILD_PLATFORM
|
"linux+x86-64")
|
||||||
[[ $platform = "linux+x86-64" ]] && EXTENSION="deb"
|
BUILD_PLATFORM="amd64"
|
||||||
|
EXTENSION="deb"
|
||||||
|
;;
|
||||||
|
"linux+aarch64")
|
||||||
|
BUILD_PLATFORM="aarch64"
|
||||||
|
EXTENSION="deb"
|
||||||
|
;;
|
||||||
|
"darwin+aarch64")
|
||||||
|
BUILD_PLATFORM="aarch64"
|
||||||
|
EXTENSION="dmg"
|
||||||
|
;;
|
||||||
|
"darwin+x86-64")
|
||||||
|
BUILD_PLATFORM="x64"
|
||||||
|
EXTENSION="dmg"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Unknown platform $platform"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
echo "build_platform=$BUILD_PLATFORM" >> $GITHUB_OUTPUT
|
echo "build_platform=$BUILD_PLATFORM" >> $GITHUB_OUTPUT
|
||||||
echo "extension=$EXTENSION" >> $GITHUB_OUTPUT
|
echo "extension=$EXTENSION" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: zip .app for MacOS
|
- name: zip .app for MacOS
|
||||||
if: startsWith(matrix.platform.name, 'darwin')
|
if: startsWith(matrix.platform, 'darwin+')
|
||||||
run: |
|
run: |
|
||||||
cd ./modules/gui/src-tauri/target/release/bundle/macos/ && zip -r tea.zip tea.app
|
cd ./modules/gui/src-tauri/target/release/bundle/macos/
|
||||||
|
zip -r tea.zip tea.app
|
||||||
|
|
||||||
- name: cp package images from prod to gui bucket
|
- name: cp package images from prod to gui bucket
|
||||||
env:
|
env:
|
||||||
platform: ${{ steps.build_platform.outputs.build_platform }}
|
platform: ${{ steps.build_platform.outputs.build_platform }}
|
||||||
build_platform: ${{ matrix.platform.name }}
|
build_platform: ${{ matrix.platform }}
|
||||||
extension: ${{steps.build_platform.outputs.extension}}
|
extension: ${{steps.build_platform.outputs.extension}}
|
||||||
run: |
|
run: |
|
||||||
aws s3 cp "./modules/gui/src-tauri/target/release/bundle/$extension/tea_0.1.0_$platform.$extension" \
|
aws s3 cp \
|
||||||
|
"./$extension/tea_0.1.0_$platform.$extension" \
|
||||||
"s3://preview.gui.tea.xyz/release/tea_${{ steps.date.outputs.unix_seconds }}_$platform.$extension"
|
"s3://preview.gui.tea.xyz/release/tea_${{ steps.date.outputs.unix_seconds }}_$platform.$extension"
|
||||||
|
|
||||||
- name: cp package zip for MacOS
|
- name: cp package zip for MacOS
|
||||||
if: startsWith(matrix.platform.name, 'darwin')
|
if: startsWith(matrix.platform, 'darwin')
|
||||||
env:
|
env:
|
||||||
platform: ${{ steps.build_platform.outputs.build_platform }}
|
platform: ${{ steps.build_platform.outputs.build_platform }}
|
||||||
build_platform: ${{ matrix.platform.name }}
|
build_platform: ${{ matrix.platform }}
|
||||||
run: |
|
run: |
|
||||||
aws s3 cp ./modules/gui/src-tauri/target/release/bundle/macos/tea.zip "s3://preview.gui.tea.xyz/release/tea_${{ steps.date.outputs.unix_seconds }}_$platform.zip"
|
aws s3 cp ./macos/tea.zip \
|
||||||
|
"s3://preview.gui.tea.xyz/release/tea_${{ steps.date.outputs.unix_seconds }}_$platform.zip"
|
||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 18
|
node-version: 18
|
||||||
|
@ -133,15 +197,15 @@ jobs:
|
||||||
run: ./.github/notify-slack.js
|
run: ./.github/notify-slack.js
|
||||||
env:
|
env:
|
||||||
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
|
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
|
||||||
PLATFORM: ${{ matrix.platform.name }}
|
PLATFORM: ${{ matrix.platform }}
|
||||||
EXT: ${{ steps.build_platform.outputs.extension }}
|
EXT: ${{ steps.build_platform.outputs.extension }}
|
||||||
DOWNLOAD_URL: http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/release/tea_${{ steps.date.outputs.unix_seconds }}_${{ steps.build_platform.outputs.build_platform }}.${{ steps.build_platform.outputs.extension }}
|
DOWNLOAD_URL: http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/release/tea_${{ steps.date.outputs.unix_seconds }}_${{ steps.build_platform.outputs.build_platform }}.${{ steps.build_platform.outputs.extension }}
|
||||||
|
|
||||||
- name: Slack Notification for .app Mac
|
- name: Slack Notification for .app Mac
|
||||||
run: ./.github/notify-slack.js
|
run: ./.github/notify-slack.js
|
||||||
if: startsWith(matrix.platform.name, 'darwin')
|
if: startsWith(matrix.platform, 'darwin')
|
||||||
env:
|
env:
|
||||||
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
|
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
|
||||||
PLATFORM: ${{ matrix.platform.name }}
|
PLATFORM: ${{ matrix.platform }}
|
||||||
EXT: .zip(.app)
|
EXT: .zip(.app)
|
||||||
DOWNLOAD_URL: http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/release/tea_${{ steps.date.outputs.unix_seconds }}_${{ steps.build_platform.outputs.build_platform }}.zip
|
DOWNLOAD_URL: http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/release/tea_${{ steps.date.outputs.unix_seconds }}_${{ steps.build_platform.outputs.build_platform }}.zip
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
#![cfg_attr(
|
#![cfg_attr(
|
||||||
all(not(debug_assertions), target_os = "windows"),
|
all(not(debug_assertions), target_os = "windows"),
|
||||||
windows_subsystem = "windows"
|
windows_subsystem = "windows"
|
||||||
)]
|
)]
|
||||||
|
|
||||||
mod handlers;
|
mod handlers;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
tauri::Builder::default()
|
tauri::Builder::default()
|
||||||
.invoke_handler(tauri::generate_handler![
|
.invoke_handler(tauri::generate_handler![
|
||||||
handlers::packages::install_package,
|
handlers::packages::install_package,
|
||||||
])
|
])
|
||||||
.run(tauri::generate_context!())
|
.run(tauri::generate_context!())
|
||||||
.expect("error while running tauri application");
|
.expect("error while running tauri application");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue