mirror of
https://github.com/ivabus/gui
synced 2025-06-07 15:50:27 +03:00
Merge branch 'main' of github.com:teaxyz/gui into github-oauth
This commit is contained in:
commit
b0e0b90334
13 changed files with 311 additions and 89 deletions
2
.github/notify-slack.js
vendored
2
.github/notify-slack.js
vendored
|
@ -8,7 +8,7 @@ async function main() {
|
||||||
type: 'section',
|
type: 'section',
|
||||||
text: {
|
text: {
|
||||||
type: 'mrkdwn',
|
type: 'mrkdwn',
|
||||||
text: `NEW BUILD FOR ${process.env.PLATFORM} <${process.env.DOWNLOAD_URL}|download ${process.env.VERSION || ''}>`
|
text: `NEW BUILD FOR ${process.env.PLATFORM} <${process.env.DOWNLOAD_URL}|download ${process.env.EXT || 'bin'} ${process.env.VERSION || ''}>`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
77
.github/workflows/ci.yml
vendored
77
.github/workflows/ci.yml
vendored
|
@ -107,7 +107,8 @@ jobs:
|
||||||
with:
|
with:
|
||||||
message-id: preview-comment-${{needs.changes.outputs.preview_folder}}
|
message-id: preview-comment-${{needs.changes.outputs.preview_folder}}
|
||||||
message: |
|
message: |
|
||||||
**preview is at**: [https://${{steps.preview_setup.outputs.domain}}](https://${{steps.preview_setup.outputs.domain}})
|
**preview is at**:
|
||||||
|
<a href="https://${{steps.preview_setup.outputs.domain}}" target="_blank">here</a>
|
||||||
```bash
|
```bash
|
||||||
https://${{steps.preview_setup.outputs.domain}}
|
https://${{steps.preview_setup.outputs.domain}}
|
||||||
```
|
```
|
||||||
|
@ -122,34 +123,40 @@ 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
|
||||||
# - os: [self-hosted, linux, ARM64]
|
# - os: [self-hosted, linux, ARM64]
|
||||||
# name: linux+aarch64
|
# name: linux+aarch64
|
||||||
container: ${{ matrix.platform.container }}
|
container: ${{ matrix.platform.container }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- uses: pnpm/action-setup@v2
|
- uses: pnpm/action-setup@v2
|
||||||
with:
|
with:
|
||||||
version: 7
|
version: 7
|
||||||
- name: setup node
|
- name: setup node
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v1
|
||||||
with:
|
with:
|
||||||
node-version: 16
|
node-version: 18
|
||||||
cache: 'pnpm'
|
cache: 'pnpm'
|
||||||
cache-dependency-path: pnpm-lock.yaml
|
cache-dependency-path: pnpm-lock.yaml
|
||||||
- name: install Rust stable
|
- name: install Rust stable
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
with:
|
with:
|
||||||
toolchain: stable
|
toolchain: stable
|
||||||
|
- name: install app dependencies
|
||||||
|
run: pnpm install
|
||||||
|
|
||||||
- name: install dependencies (ubuntu only)
|
- name: install dependencies (ubuntu only)
|
||||||
if: matrix.platform.name == 'linux+x86-64'
|
if: matrix.platform.name == 'linux+x86-64'
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf pkg-config
|
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf pkg-config
|
||||||
|
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
with:
|
with:
|
||||||
# The prefix cache key, this can be changed to start a new cache manually.
|
# The prefix cache key, this can be changed to start a new cache manually.
|
||||||
|
@ -157,8 +164,6 @@ jobs:
|
||||||
prefix-key: ${{ matrix.platform.name }}
|
prefix-key: ${{ matrix.platform.name }}
|
||||||
shared-key: ci
|
shared-key: ci
|
||||||
cache-targets: false
|
cache-targets: false
|
||||||
- name: install app dependencies
|
|
||||||
run: pnpm install
|
|
||||||
|
|
||||||
- name: Cache Tauri Target
|
- name: Cache Tauri Target
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
|
@ -182,8 +187,28 @@ jobs:
|
||||||
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: test build tauri
|
- name: test build tauri for MacOS
|
||||||
run: pnpm --filter gui tauri build
|
if: matrix.platform.name == 'darwin+x86-64' || matrix.platform.name == 'darwin+aarch64'
|
||||||
|
# FROM: https://tauri.app/v1/guides/distribution/sign-macos
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
ENABLE_CODE_SIGNING: ${{ secrets.GUI_APPLE_CERTIFICATE }}
|
||||||
|
APPLE_CERTIFICATE: ${{ secrets.GUI_APPLE_CERTIFICATE }}
|
||||||
|
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.GUI_APPLE_CERTIFICATE_PASSWORD }}
|
||||||
|
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
|
||||||
|
APPLE_ID: ${{ secrets.APPLE_ID }}
|
||||||
|
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
|
||||||
|
run: pnpm build:gui
|
||||||
|
|
||||||
|
- name: test build tauri for Linux
|
||||||
|
if: matrix.platform.name == 'linux+x86-64'
|
||||||
|
# TODO: https://tauri.app/v1/guides/distribution/sign-linux
|
||||||
|
run: pnpm build:gui
|
||||||
|
|
||||||
|
- name: zip .app for MacOS
|
||||||
|
if: matrix.platform.name == 'darwin+x86-64' || matrix.platform.name == 'darwin+aarch64'
|
||||||
|
run: |
|
||||||
|
cd ./modules/gui/src-tauri/target/release/bundle/macos/ && zip -r tea.zip tea.app
|
||||||
|
|
||||||
- uses: aws-actions/configure-aws-credentials@v1
|
- uses: aws-actions/configure-aws-credentials@v1
|
||||||
with:
|
with:
|
||||||
|
@ -198,15 +223,43 @@ jobs:
|
||||||
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 "./modules/gui/src-tauri/target/release/bundle/$extension/tea_0.1.0_$platform.$extension" \
|
||||||
"s3://preview.gui.tea.xyz/$prefix/gui_$platform.$extension"
|
"s3://preview.gui.tea.xyz/$prefix/tea_$platform.$extension"
|
||||||
|
|
||||||
- name: comment install
|
- name: cp package zip for MacOS
|
||||||
|
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
|
||||||
|
if: matrix.platform.name == 'linux+x86-64'
|
||||||
uses: mshick/add-pr-comment@v2
|
uses: mshick/add-pr-comment@v2
|
||||||
with:
|
with:
|
||||||
message-id: ${{ matrix.platform.name }}-comment
|
message-id: ${{ matrix.platform.id }}-comment
|
||||||
message: |
|
message: |
|
||||||
**installer for ${{ matrix.platform.name }} is at**: [here](http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/${{ needs.changes.outputs.preview_folder }}/gui_${{steps.build_platform.outputs.build_platform}}.${{steps.build_platform.outputs.extension}})
|
**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
|
```bash
|
||||||
http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/${{ needs.changes.outputs.preview_folder }}/gui_${{ steps.build_platform.outputs.build_platform }}.${{ steps.build_platform.outputs.extension }}
|
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: matrix.platform.name == 'darwin+x86-64' || matrix.platform.name == 'darwin+aarch64'
|
||||||
|
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
|
copy-paste into a browser to download
|
42
.github/workflows/main.yml
vendored
42
.github/workflows/main.yml
vendored
|
@ -113,8 +113,23 @@ jobs:
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ matrix.platform.name }}-build-target-prod
|
${{ matrix.platform.name }}-build-target-prod
|
||||||
|
|
||||||
- name: test build tauri
|
- name: test build tauri for MacOS
|
||||||
run: pnpm --filter gui tauri build
|
if: matrix.platform.name == 'darwin+x86-64' || matrix.platform.name == 'darwin+aarch64'
|
||||||
|
# FROM: https://tauri.app/v1/guides/distribution/sign-macos
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
ENABLE_CODE_SIGNING: ${{ secrets.GUI_APPLE_CERTIFICATE }}
|
||||||
|
APPLE_CERTIFICATE: ${{ secrets.GUI_APPLE_CERTIFICATE }}
|
||||||
|
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.GUI_APPLE_CERTIFICATE_PASSWORD }}
|
||||||
|
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
|
||||||
|
APPLE_ID: ${{ secrets.APPLE_ID }}
|
||||||
|
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
|
||||||
|
run: pnpm build:gui
|
||||||
|
|
||||||
|
- name: test build tauri for Linux
|
||||||
|
if: matrix.platform.name == 'linux+x86-64'
|
||||||
|
# TODO: https://tauri.app/v1/guides/distribution/sign-linux
|
||||||
|
run: pnpm build:gui
|
||||||
|
|
||||||
- name: Get current unix ts - seconds
|
- name: Get current unix ts - seconds
|
||||||
id: date
|
id: date
|
||||||
|
@ -138,6 +153,11 @@ jobs:
|
||||||
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
|
||||||
|
if: matrix.platform.name == 'darwin+x86-64' || matrix.platform.name == 'darwin+aarch64'
|
||||||
|
run: |
|
||||||
|
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 }}
|
||||||
|
@ -147,9 +167,27 @@ jobs:
|
||||||
aws s3 cp "./modules/gui/src-tauri/target/release/bundle/$extension/tea_0.1.0_$platform.$extension" \
|
aws s3 cp "./modules/gui/src-tauri/target/release/bundle/$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
|
||||||
|
if: matrix.platform.name == 'darwin+x86-64' || matrix.platform.name == 'darwin+aarch64'
|
||||||
|
env:
|
||||||
|
platform: ${{ steps.build_platform.outputs.build_platform }}
|
||||||
|
build_platform: ${{ matrix.platform.name }}
|
||||||
|
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"
|
||||||
|
|
||||||
- name: Slack Notification
|
- name: Slack Notification
|
||||||
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.name }}
|
||||||
|
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
|
||||||
|
run: ./.github/notify-slack.js
|
||||||
|
if: matrix.platform.name == 'darwin+x86-64' || matrix.platform.name == 'darwin+aarch64'
|
||||||
|
env:
|
||||||
|
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
|
||||||
|
PLATFORM: ${{ matrix.platform.name }}
|
||||||
|
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
|
||||||
|
|
46
.github/workflows/release.yml
vendored
46
.github/workflows/release.yml
vendored
|
@ -70,8 +70,23 @@ jobs:
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ matrix.platform.name }}-build-target-prod
|
${{ matrix.platform.name }}-build-target-prod
|
||||||
|
|
||||||
- name: test build tauri
|
- name: test build tauri for MacOS
|
||||||
run: pnpm --filter gui tauri build
|
if: matrix.platform.name == 'darwin+x86-64' || matrix.platform.name == 'darwin+aarch64'
|
||||||
|
# FROM: https://tauri.app/v1/guides/distribution/sign-macos
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
ENABLE_CODE_SIGNING: ${{ secrets.GUI_APPLE_CERTIFICATE }}
|
||||||
|
APPLE_CERTIFICATE: ${{ secrets.GUI_APPLE_CERTIFICATE }}
|
||||||
|
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.GUI_APPLE_CERTIFICATE_PASSWORD }}
|
||||||
|
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
|
||||||
|
APPLE_ID: ${{ secrets.APPLE_ID }}
|
||||||
|
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
|
||||||
|
run: pnpm build:gui
|
||||||
|
|
||||||
|
- name: test build tauri for Linux
|
||||||
|
if: matrix.platform.name == 'linux+x86-64'
|
||||||
|
# TODO: https://tauri.app/v1/guides/distribution/sign-linux
|
||||||
|
run: pnpm build:gui
|
||||||
|
|
||||||
- name: Get current unix ts - seconds
|
- name: Get current unix ts - seconds
|
||||||
id: date
|
id: date
|
||||||
|
@ -98,10 +113,37 @@ jobs:
|
||||||
aws s3 cp "./modules/gui/src-tauri/target/release/bundle/$extension/tea_0.1.0_$platform.$extension" \
|
aws s3 cp "./modules/gui/src-tauri/target/release/bundle/$extension/tea_0.1.0_$platform.$extension" \
|
||||||
"s3://preview.gui.tea.xyz/release/tea_gui_$tag_$platform.$extension"
|
"s3://preview.gui.tea.xyz/release/tea_gui_$tag_$platform.$extension"
|
||||||
|
|
||||||
|
- name: zip .app for MacOS
|
||||||
|
if: matrix.platform.name == 'darwin+x86-64' || matrix.platform.name == 'darwin+aarch64'
|
||||||
|
run: |
|
||||||
|
cd ./modules/gui/src-tauri/target/release/bundle/macos/ && zip -r tea.zip tea.app
|
||||||
|
|
||||||
|
- name: publish .zip(.app) for MacOS
|
||||||
|
if: matrix.platform.name == 'darwin+x86-64' || matrix.platform.name == 'darwin+aarch64'
|
||||||
|
env:
|
||||||
|
platform: ${{ steps.build_platform.outputs.build_platform }}
|
||||||
|
extension: ${{ steps.build_platform.outputs.extension }}
|
||||||
|
tag: ${{ steps.tag.outputs.tag }}
|
||||||
|
run: |
|
||||||
|
aws s3 cp "./modules/gui/src-tauri/target/release/bundle/macos/tea.zip" \
|
||||||
|
"s3://preview.gui.tea.xyz/release/tea_gui_latest_$platform.zip"
|
||||||
|
aws s3 cp "./modules/gui/src-tauri/target/release/bundle/macos/tea.zip" \
|
||||||
|
"s3://preview.gui.tea.xyz/release/tea_gui_$tag_$platform.zip"
|
||||||
- name: Slack Notification
|
- name: Slack Notification
|
||||||
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.name }}
|
||||||
VERSION: ${{steps.tag.outputs.tag}}
|
VERSION: ${{steps.tag.outputs.tag}}
|
||||||
|
EXT: ${{ steps.build_platform.outputs.extension }}
|
||||||
DOWNLOAD_URL: http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/release/tea_gui_${{steps.tag.outputs.tag}}_${{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_gui_${{steps.tag.outputs.tag}}_${{steps.build_platform.outputs.build_platform}}.${{ steps.build_platform.outputs.extension }}
|
||||||
|
|
||||||
|
- name: Slack Notification for .app Mac
|
||||||
|
run: ./.github/notify-slack.js
|
||||||
|
if: matrix.platform.name == 'darwin+x86-64' || matrix.platform.name == 'darwin+aarch64'
|
||||||
|
env:
|
||||||
|
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
|
||||||
|
PLATFORM: ${{ matrix.platform.name }}
|
||||||
|
VERSION: ${{steps.tag.outputs.tag}}
|
||||||
|
EXT: .zip(.app)
|
||||||
|
DOWNLOAD_URL: http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/release/tea_gui_${{steps.tag.outputs.tag}}_${{steps.build_platform.outputs.build_platform}}.zip
|
||||||
|
|
|
@ -30,6 +30,7 @@ $ pnpm web:gui
|
||||||
```
|
```
|
||||||
# Build
|
# Build
|
||||||
```sh
|
```sh
|
||||||
|
pnpm install
|
||||||
pnpm build:gui
|
pnpm build:gui
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
"http": {
|
"http": {
|
||||||
"all": true,
|
"all": true,
|
||||||
"request": true,
|
"request": true,
|
||||||
"scope": ["https://api.tea.xyz/v1/*", "https://github.com/*", "http://localhost:3000/v1/*"]
|
"scope": ["https://api.tea.xyz/v1/*", "https://github.com/*", "http://localhost:3000/v1/*", "https://app.tea.xyz/*"]
|
||||||
},
|
},
|
||||||
"shell": {
|
"shell": {
|
||||||
"all": true,
|
"all": true,
|
||||||
|
|
|
@ -1,12 +1,15 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import '$appcss';
|
import '$appcss';
|
||||||
import '@tea/ui/icons/icons.css';
|
import '@tea/ui/icons/icons.css';
|
||||||
import type { Package } from '@tea/ui/types';
|
import type { Package, Bottle } from '@tea/ui/types';
|
||||||
import Button from '@tea/ui/Button/Button.svelte';
|
import Button from '@tea/ui/Button/Button.svelte';
|
||||||
import StarRating from '@tea/ui/StarRating/StarRating.svelte';
|
import StarRating from '@tea/ui/StarRating/StarRating.svelte';
|
||||||
|
import Bottles from '@tea/ui/Bottles/Bottles.svelte';
|
||||||
|
import { onMount } from 'svelte';
|
||||||
|
import { getPackageBottles } from '@api';
|
||||||
|
|
||||||
export let pkg: Package;
|
export let pkg: Package;
|
||||||
|
let bottles: Bottle[] = [];
|
||||||
let packageRating = 0;
|
let packageRating = 0;
|
||||||
let copyButtonText = 'COPY';
|
let copyButtonText = 'COPY';
|
||||||
const copyValue = `sh <(curl tea.xyz ) +${pkg.full_name}`;
|
const copyValue = `sh <(curl tea.xyz ) +${pkg.full_name}`;
|
||||||
|
@ -15,6 +18,14 @@
|
||||||
copyButtonText = 'COPIED!';
|
copyButtonText = 'COPIED!';
|
||||||
navigator.clipboard.writeText(copyValue);
|
navigator.clipboard.writeText(copyValue);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
onMount(async () => {
|
||||||
|
try {
|
||||||
|
bottles = await getPackageBottles(pkg.full_name);
|
||||||
|
} catch (err) {
|
||||||
|
console.error(err);
|
||||||
|
}
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<section class="mt-4 border border-gray bg-black">
|
<section class="mt-4 border border-gray bg-black">
|
||||||
|
@ -33,6 +44,9 @@
|
||||||
<p class="mt-4 font-sono text-sm">{pkg.desc}</p>
|
<p class="mt-4 font-sono text-sm">{pkg.desc}</p>
|
||||||
</article>
|
</article>
|
||||||
</header>
|
</header>
|
||||||
|
<section>
|
||||||
|
<Bottles {bottles} />
|
||||||
|
</section>
|
||||||
<footer class="flex h-20 border-t border-gray text-white">
|
<footer class="flex h-20 border-t border-gray text-white">
|
||||||
<input class="click-copy flex-grow bg-black pl-4" disabled value={copyValue} />
|
<input class="click-copy flex-grow bg-black pl-4" disabled value={copyValue} />
|
||||||
<Button class="w-16 border-0 border-l-2 text-sm" onClick={onCopy}>{copyButtonText}</Button>
|
<Button class="w-16 border-0 border-l-2 text-sm" onClick={onCopy}>{copyButtonText}</Button>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* TODO:
|
* TODO:
|
||||||
* * make cors work with api.tea.xyz/v1
|
* * make cors work with api.tea.xyz/v1
|
||||||
*/
|
*/
|
||||||
import type { Package, Review, AirtablePost } from '@tea/ui/types';
|
import type { Package, Review, AirtablePost, Bottle } from '@tea/ui/types';
|
||||||
import type { GUIPackage, Course, Category } from '../types';
|
import type { GUIPackage, Course, Category } from '../types';
|
||||||
import { PackageStates } from '../types';
|
import { PackageStates } from '../types';
|
||||||
import { loremIpsum } from 'lorem-ipsum';
|
import { loremIpsum } from 'lorem-ipsum';
|
||||||
|
@ -341,3 +341,16 @@ export async function getDeviceAuth(): Promise<any> {
|
||||||
key: 'xxx'
|
key: 'xxx'
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function getPackageBottles(name: string): Promise<Bottle[]> {
|
||||||
|
return [
|
||||||
|
{ name, platform: 'darwin', arch: 'aarch64', version: '3.39.4' },
|
||||||
|
{ name, platform: 'darwin', arch: 'aarch64', version: '3.40.0' },
|
||||||
|
{ name, platform: 'darwin', arch: 'x86-64', version: '3.39.4' },
|
||||||
|
{ name, platform: 'darwin', arch: 'x86-64', version: '3.40.0' },
|
||||||
|
{ name, platform: 'linux', arch: 'aarch64', version: '3.39.4' },
|
||||||
|
{ name, platform: 'linux', arch: 'aarch64', version: '3.40.0' },
|
||||||
|
{ name, platform: 'linux', arch: 'x86-64', version: '3.39.4' },
|
||||||
|
{ name, platform: 'linux', arch: 'x86-64', version: '3.40.0' }
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
|
@ -14,8 +14,10 @@ import { getClient } from '@tauri-apps/api/http';
|
||||||
// import { invoke } from '@tauri-apps/api';
|
// import { invoke } from '@tauri-apps/api';
|
||||||
import { Command } from '@tauri-apps/api/shell';
|
import { Command } from '@tauri-apps/api/shell';
|
||||||
import { readDir, BaseDirectory } from '@tauri-apps/api/fs';
|
import { readDir, BaseDirectory } from '@tauri-apps/api/fs';
|
||||||
import type { Package, Review, AirtablePost, User } from '@tea/ui/types';
|
|
||||||
|
import type { Package, Review, AirtablePost, User, Bottle } from '@tea/ui/types';
|
||||||
import type { GUIPackage, Course, Category, AuthStatus } from '../types';
|
import type { GUIPackage, Course, Category, AuthStatus } from '../types';
|
||||||
|
|
||||||
import * as mock from './mock';
|
import * as mock from './mock';
|
||||||
import { PackageStates } from '../types';
|
import { PackageStates } from '../types';
|
||||||
|
|
||||||
|
@ -176,5 +178,13 @@ type DeviceAuth = {
|
||||||
export async function getDeviceAuth(): Promise<DeviceAuth> {
|
export async function getDeviceAuth(): Promise<DeviceAuth> {
|
||||||
const deviceId = 'xyxz123';
|
const deviceId = 'xyxz123';
|
||||||
const data = await get<DeviceAuth>(`/auth/device/${deviceId}`);
|
const data = await get<DeviceAuth>(`/auth/device/${deviceId}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function getPackageBottles(packageName: string): Promise<Bottle[]> {
|
||||||
|
console.log('getting bottles for ', packageName);
|
||||||
|
const client = await getClient();
|
||||||
|
const uri = join('https://app.tea.xyz/api/bottles/', packageName);
|
||||||
|
const { data } = await client.get<Bottle[]>(uri.toString());
|
||||||
|
console.log('got bottles', data);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,6 +30,3 @@
|
||||||
<News />
|
<News />
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<style>
|
|
||||||
</style>
|
|
||||||
|
|
47
modules/ui/src/Bottles/Bottles.svelte
Normal file
47
modules/ui/src/Bottles/Bottles.svelte
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
<script lang="ts">
|
||||||
|
import type { Bottle } from '../types';
|
||||||
|
export let bottles: Bottle[];
|
||||||
|
|
||||||
|
let versions: string[] = [];
|
||||||
|
let available: Set<string>;
|
||||||
|
|
||||||
|
$: versions = [...new Set(bottles.map((b) => b.version))];
|
||||||
|
$: available = new Set(bottles.map((b) => `${b.platform}-${b.arch}`));
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div class="my-4 w-full p-2">
|
||||||
|
<div>
|
||||||
|
<h4 class="mb-4 text-lg text-primary">
|
||||||
|
{versions.length} version{versions.length === 1 ? '' : 's'} bottled
|
||||||
|
</h4>
|
||||||
|
</div>
|
||||||
|
<table class="w-full table-auto border border-gray font-sono">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th class="border border-gray px-2 py-4">version</th>
|
||||||
|
<th class="border border-gray px-2 py-4">darwin-aarch64</th>
|
||||||
|
<th class="border border-gray px-2 py-4">darwin-x86-64</th>
|
||||||
|
<th class="border border-gray px-2 py-4">linux-aarch64</th>
|
||||||
|
<th class="border border-gray px-2 py-4">linux-x86-64</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{#each versions as version}
|
||||||
|
<tr>
|
||||||
|
<th class="border border-gray px-2 py-4 text-left">{version}</th>
|
||||||
|
<td class="border border-gray px-2 py-4"
|
||||||
|
>{available.has('darwin-aarch64') ? '✅' : '❌'}</td
|
||||||
|
>
|
||||||
|
<td class="border border-gray px-2 py-4"
|
||||||
|
>{available.has('darwin-x86-64') ? '✅' : '❌'}</td
|
||||||
|
>
|
||||||
|
<td class="border border-gray px-2 py-4"
|
||||||
|
>{available.has('linux-aarch64') ? '✅' : '❌'}</td
|
||||||
|
>
|
||||||
|
<td class="border border-gray px-2 py-4">{available.has('linux-x86-64') ? '✅' : '❌'}</td
|
||||||
|
>
|
||||||
|
</tr>
|
||||||
|
{/each}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
|
@ -43,3 +43,10 @@ export type User = {
|
||||||
country?: string;
|
country?: string;
|
||||||
wallet?: string;
|
wallet?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type Bottle = {
|
||||||
|
name: string;
|
||||||
|
platform: string;
|
||||||
|
arch: string;
|
||||||
|
version: string;
|
||||||
|
};
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"release": "sh ./.github/update-latest-binary.sh",
|
"release": "sh ./.github/update-latest-binary.sh",
|
||||||
"build:gui": "pnpm --filter gui exec tauri build",
|
"build:gui": "pnpm --filter gui exec tauri build --verbose",
|
||||||
"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"
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue