Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: tauri #488

Draft
wants to merge 62 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
fe21128
feat: tauri init
sunchanglong Feb 19, 2025
5a72577
feat: icon
sunchanglong Feb 11, 2025
1b5a5b3
feat: tauri release
sunchanglong Feb 11, 2025
8a84cf9
chore: update actoin name
sunchanglong Feb 11, 2025
5f311b1
build: use tauri demo action
sunchanglong Feb 11, 2025
b426ea5
chore: test ci
sunchanglong Feb 12, 2025
ed8f472
build: action on condition
sunchanglong Feb 12, 2025
d069a86
fix: br name
sunchanglong Feb 12, 2025
af70724
build: use pnpm
sunchanglong Feb 12, 2025
0256242
build: pnpm
sunchanglong Feb 12, 2025
b69d732
build: pnpm
sunchanglong Feb 12, 2025
0e1654f
build: cross env
sunchanglong Feb 12, 2025
0c2ef87
feat: release action
sunchanglong Feb 19, 2025
f05160f
build: sign
sunchanglong Feb 12, 2025
8ccba16
build: release condition remove push
sunchanglong Feb 12, 2025
5ddb6bd
feat: updater
sunchanglong Feb 13, 2025
9fd7f6d
build: push
sunchanglong Feb 13, 2025
6fb551c
build: remove upload latest step
sunchanglong Feb 13, 2025
05a3e64
fix: updater release
sunchanglong Feb 13, 2025
045bfc5
build: add env
sunchanglong Feb 13, 2025
1197030
build: env key
sunchanglong Feb 13, 2025
3b1279a
fix: pubkey
sunchanglong Feb 13, 2025
4114e84
feat: checkupdate
sunchanglong Feb 13, 2025
5c2305e
build: crossenv
sunchanglong Feb 14, 2025
9428af9
build: update pnpm lockfile
sunchanglong Feb 14, 2025
bcd627e
build: release
sunchanglong Feb 14, 2025
ab3dfe5
feat: windows sign
sunchanglong Feb 19, 2025
8bfdc04
chore: release branch
sunchanglong Feb 19, 2025
14b63c7
build: update pnpm lockfile
sunchanglong Feb 19, 2025
3a370a0
chore: release
sunchanglong Feb 19, 2025
416e484
chore: release file
sunchanglong Feb 19, 2025
bb137ee
chore: try to release one
sunchanglong Feb 19, 2025
f7b5bc3
chore: release file
sunchanglong Feb 20, 2025
61cf182
chore: tagname
sunchanglong Feb 20, 2025
c283198
fix: release tag
sunchanglong Feb 20, 2025
8567f5b
fix: tag name
sunchanglong Feb 20, 2025
b574f03
fix: tagname
sunchanglong Feb 20, 2025
8e08dcb
feat: basic workable
sunchanglong Feb 21, 2025
0662640
feat: lint
sunchanglong Feb 21, 2025
af412d8
fix: version
sunchanglong Feb 21, 2025
89291f2
feat: about page
sunchanglong Feb 24, 2025
04a8375
chore: icon
sunchanglong Feb 24, 2025
036d1f9
chore: version
sunchanglong Feb 24, 2025
7ceb31d
chore: icon
sunchanglong Feb 24, 2025
3c803fe
fix: icon
sunchanglong Feb 24, 2025
ae93ee3
chore: version
sunchanglong Feb 24, 2025
68bee89
fix: about
sunchanglong Feb 24, 2025
0f049d0
chore: icon
sunchanglong Feb 25, 2025
2d99f5d
feat: tauri host
sunchanglong Feb 25, 2025
e29b206
fix: icon
sunchanglong Feb 25, 2025
cf9964f
fix: route
sunchanglong Feb 25, 2025
af420f5
feat: version
sunchanglong Feb 25, 2025
727eb64
fix: release latest
sunchanglong Feb 25, 2025
8186ee1
feat: baseurl
sunchanglong Feb 25, 2025
030cfa1
chore: debug
sunchanglong Feb 25, 2025
c01b841
fix: release args
sunchanglong Feb 25, 2025
05cf992
fix: release
sunchanglong Feb 25, 2025
e139195
fix: version
sunchanglong Feb 25, 2025
71cb260
fix: debug
sunchanglong Feb 25, 2025
70f172b
fix: width
sunchanglong Feb 25, 2025
39acf37
chore: name
sunchanglong Feb 26, 2025
392da8c
fix: host name
sunchanglong Feb 26, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,7 @@ module.exports = {
'noUnusedLocals': 0,
'prefer-destructuring': ['error', { object: true, array: false }],
'no-continue': 1,
'no-console': 0,
'no-underscore-dangle': 0,
},
}
156 changes: 127 additions & 29 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
on:
push:
tags:
- 'v*.*.*'
- 'test*.*.*'
workflow_dispatch:

name: Release

jobs:
build:
name: Build
runs-on: ubuntu-latest
outputs:
tag_name: ${{ steps.get_tag.outputs.tag_name }} # Store tag for other jobs
steps:
- name: Checkout sources
uses: actions/checkout@v4
Expand All @@ -33,51 +36,146 @@ jobs:
run: |
tar -czvf release/build.tar.gz ./dist
cd release && shasum -a 256 build.tar.gz > sha256.txt && cd ../

- name: Publish release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
prerelease: false
make_latest: false
files: |
release/build.tar.gz
release/sha256.txt

sync:
name: Create PR to update VERSION
needs: [build]
runs-on: ubuntu-latest
- name: Get tag name
id: get_tag
run: echo "tag_name=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT



publish-tauri:
needs: build
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
- platform: 'macos-latest' # for Arm based macs (M1 and above).
args: '--target aarch64-apple-darwin'
- platform: 'macos-latest' # for Intel based macs.
args: '--target x86_64-apple-darwin'
- platform: 'ubuntu-22.04'
args: ''
- platform: 'windows-latest'
args: ''

runs-on: ${{ matrix.platform }}
env:
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD}}
RELEASE_TAG: ${{ needs.build.outputs.tag_name }} # Get the release tag from the build job
steps:
- uses: actions/checkout@v4

- name: install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-22.04' # This must match the platform value defined above.
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf

- name: setup node
uses: actions/setup-node@v4
with:
node-version: lts/*

- uses: pnpm/action-setup@v4
with:
repository: 'GreptimeTeam/greptimedb'
- id: update-version
version: 9.1.0

- name: install Rust stable
uses: dtolnay/rust-toolchain@stable # Set this to dtolnay/rust-toolchain@nightly
with:
# Those targets are only used on macos runners so it's in an `if` to slightly speed up windows and linux builds.
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}

- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: './src-tauri -> target'

- name: install frontend dependencies
# If you don't have `beforeBuildCommand` configured you may want to build your frontend here too.
run: pnpm install --frozen-lockfile

- name: Import macOS certificate
if: matrix.platform == 'macos-latest'
run: |
cd src/servers/dashboard/
echo ${{ github.ref_name }} > VERSION
- uses: peter-evans/create-pull-request@v4
echo "${{ secrets.MACOS_CERTIFICATE }}" | base64 --decode > certificate.p12
security create-keychain -p "" build.keychain
security import certificate.p12 -k build.keychain -P "${{ secrets.MACOS_CERTIFICATE_PASSWORD }}" -T /usr/bin/codesign
security list-keychains -s build.keychain
security default-keychain -s build.keychain
security unlock-keychain -p "" build.keychain
security set-key-partition-list -S apple-tool:,apple: -s -k "" build.keychain
env:
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
MACOS_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}

- name: import windows certificate
if: matrix.platform == 'windows-latest'
env:
WINDOWS_CERTIFICATE: ${{ secrets.WINDOWS_CERTIFICATE }}
WINDOWS_CERTIFICATE_PASSWORD: ${{ secrets.WINDOWS_CERTIFICATE_PASSWORD }}
run: |
New-Item -ItemType directory -Path certificate
Set-Content -Path certificate/tempCert.txt -Value $env:WINDOWS_CERTIFICATE
certutil -decode certificate/tempCert.txt certificate/certificate.pfx
Remove-Item -path certificate -include tempCert.txt
Import-PfxCertificate -FilePath certificate/certificate.pfx -CertStoreLocation Cert:\CurrentUser\My -Password (ConvertTo-SecureString -String $env:WINDOWS_CERTIFICATE_PASSWORD -Force -AsPlainText)

- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
token: ${{ secrets.PR_ACTION }}
commit-message: 'feat: update dashboard to ${{ github.ref_name }}'
committer: GitHub Action <[email protected]>
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
signoff: false
branch: dashboard/${{ github.ref_name }}
delete-branch: true
title: 'feat: update dashboard to ${{ github.ref_name }}'
body: |
I hereby agree to the terms of the [GreptimeDB CLA](https://github.com/GreptimeTeam/.github/blob/main/CLA.md).
tagName: ${{ needs.build.outputs.tag_name }}
prerelease: false
args: ${{ matrix.args }}

# sync:
# name: Create PR to update VERSION
# needs: [build]
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# with:
# repository: 'GreptimeTeam/greptimedb'
# - id: update-version
# run: |
# cd src/servers/dashboard/
# echo ${{ github.ref_name }} > VERSION
# - uses: peter-evans/create-pull-request@v4
# with:
# token: ${{ secrets.PR_ACTION }}
# commit-message: 'feat: update dashboard to ${{ github.ref_name }}'
# committer: GitHub Action <[email protected]>
# author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
# signoff: false
# branch: dashboard/${{ github.ref_name }}
# delete-branch: true
# title: 'feat: update dashboard to ${{ github.ref_name }}'
# body: |
# I hereby agree to the terms of the [GreptimeDB CLA](https://github.com/GreptimeTeam/.github/blob/main/CLA.md).

## Refer to a related PR or issue link (optional)
# ## Refer to a related PR or issue link (optional)

## What's changed and what's your intention?
# ## What's changed and what's your intention?

AS TITLE
# AS TITLE

https://github.com/GreptimeTeam/dashboard/releases/tag/${{ github.ref_name }}
# https://github.com/GreptimeTeam/dashboard/releases/tag/${{ github.ref_name }}

## Checklist
# ## Checklist

- [ ] I have written the necessary rustdoc comments.
- [ ] I have added the necessary unit tests and integration tests.
- [x] This PR does not require documentation updates.
# - [ ] I have written the necessary rustdoc comments.
# - [ ] I have added the necessary unit tests and integration tests.
# - [x] This PR does not require documentation updates.
99 changes: 99 additions & 0 deletions .github/workflows/tauri-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: Tauri Release

on:
push:
branches: ['private/feat/tauri', 'private/dev']
pull_request:
branches: ['private/feat/tauri', 'private/dev']
workflow_dispatch:

jobs:
publish-tauri:
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
- platform: 'macos-latest' # for Arm based macs (M1 and above).
args: '--target aarch64-apple-darwin'
- platform: 'macos-latest' # for Intel based macs.
args: '--target x86_64-apple-darwin'
- platform: 'ubuntu-22.04'
args: ''
- platform: 'windows-latest'
args: ''

runs-on: ${{ matrix.platform }}
env:
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD}}
steps:
- uses: actions/checkout@v4

- name: install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-22.04' # This must match the platform value defined above.
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf

- name: setup node
uses: actions/setup-node@v4
with:
node-version: lts/*

- uses: pnpm/action-setup@v4
with:
version: 9.1.0

- name: install Rust stable
uses: dtolnay/rust-toolchain@stable # Set this to dtolnay/rust-toolchain@nightly
with:
# Those targets are only used on macos runners so it's in an `if` to slightly speed up windows and linux builds.
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}

- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: './src-tauri -> target'

- name: install frontend dependencies
# If you don't have `beforeBuildCommand` configured you may want to build your frontend here too.
run: pnpm install --frozen-lockfile

- name: Import macOS certificate
if: matrix.platform == 'macos-latest'
run: |
echo "${{ secrets.MACOS_CERTIFICATE }}" | base64 --decode > certificate.p12
security create-keychain -p "" build.keychain
security import certificate.p12 -k build.keychain -P "${{ secrets.MACOS_CERTIFICATE_PASSWORD }}" -T /usr/bin/codesign
security list-keychains -s build.keychain
security default-keychain -s build.keychain
security unlock-keychain -p "" build.keychain
security set-key-partition-list -S apple-tool:,apple: -s -k "" build.keychain
env:
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
MACOS_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}

- name: import windows certificate
if: matrix.platform == 'windows-latest'
env:
WINDOWS_CERTIFICATE: ${{ secrets.WINDOWS_CERTIFICATE }}
WINDOWS_CERTIFICATE_PASSWORD: ${{ secrets.WINDOWS_CERTIFICATE_PASSWORD }}
run: |
New-Item -ItemType directory -Path certificate
Set-Content -Path certificate/tempCert.txt -Value $env:WINDOWS_CERTIFICATE
certutil -decode certificate/tempCert.txt certificate/certificate.pfx
Remove-Item -path certificate -include tempCert.txt
Import-PfxCertificate -FilePath certificate/certificate.pfx -CertStoreLocation Cert:\CurrentUser\My -Password (ConvertTo-SecureString -String $env:WINDOWS_CERTIFICATE_PASSWORD -Force -AsPlainText)

- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tagName: app-v__VERSION__ # the action automatically replaces __VERSION__ with the app version.
releaseName: 'App v__VERSION__'
releaseBody: 'See the assets to download this version and install.'
releaseDraft: true
prerelease: false
args: ${{ matrix.args }}
3 changes: 3 additions & 0 deletions config/vite.config.base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@ import AutoImport from 'unplugin-auto-import/vite'

const useDevMode = true
export default defineConfig({
clearScreen: false,
envPrefix: ['VITE_', 'TAURI_'],
server: {
cors: true,
open: true,
fs: {
strict: true,
},
port: 5177,
strictPort: true,
proxy: {
'/v1': {
target: 'http://127.0.0.1:4000',
Expand Down
3 changes: 3 additions & 0 deletions config/vite.config.prod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ export default mergeConfig(
configStyleImportPlugin(),
],
build: {
target: process.env.TAURI_PLATFORM === 'windows' ? 'chrome105' : 'safari13',
minify: !process.env.TAURI_DEBUG ? 'esbuild' : false,
sourcemap: !!process.env.TAURI_DEBUG,
rollupOptions: {
output: {
manualChunks: {
Expand Down
15 changes: 10 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "greptime_dashboard",
"name": "Greptime Dashboard",
"description": "dashboard for GreptimeDB",
"version": "1.0.0",
"private": true,
Expand Down Expand Up @@ -36,6 +36,7 @@
"@babel/core": "^7.20.5",
"@codemirror/autocomplete": "^6.4.2",
"@codemirror/lang-java": "^6.0.1",
"@codemirror/lang-json": "^6.0.1",
"@codemirror/lang-python": "^6.1.0",
"@codemirror/lang-rust": "^6.0.1",
"@codemirror/lang-sql": "^6.3.1",
Expand All @@ -45,11 +46,14 @@
"@codemirror/state": "^6.2.0",
"@codemirror/theme-one-dark": "^6.1.0",
"@codemirror/view": "^6.9.3",
"@codemirror/lang-json": "^6.0.1",
"@lezer/common": "^1.0.2",
"@lezer/highlight": "^1.1.2",
"@lezer/lr": "^1.2.3",
"@prometheus-io/codemirror-promql": "^0.42.0",
"@tauri-apps/api": "^2.*",
"@tauri-apps/plugin-dialog": "^2.2.0",
"@tauri-apps/plugin-process": "^2.2.0",
"@tauri-apps/plugin-updater": "~2.5.0",
"@types/json-bigint": "^1.0.1",
"@uiw/codemirror-extensions-langs": "^4.21.13",
"@vueuse/core": "^10.1.0",
Expand All @@ -61,6 +65,7 @@
"driver.js": "^1.3.1",
"echarts": "^5.4.1",
"eslint-plugin": "^1.0.1",
"js-file-download": "^0.4.12",
"json-bigint": "^1.0.0",
"lodash": "^4.17.21",
"markdown-it-container": "^3.0.0",
Expand All @@ -85,14 +90,14 @@
"vue-codemirror": "^6.1.1",
"vue-echarts": "^6.5.0",
"vue-i18n": "^9.2.2",
"vue-router": "^4.0.14",
"js-file-download": "^0.4.12"
"vue-router": "^4.0.14"
},
"devDependencies": {
"@babel/types": "^7.21.4",
"@commitlint/cli": "^17.4.2",
"@commitlint/config-conventional": "^17.6.5",
"@prettier/plugin-pug": "^2.5.1",
"@tauri-apps/cli": "^2.2.7",
"@types/lodash": "^4.14.191",
"@types/markdown-it": "^12.2.3",
"@types/markdown-it-container": "^2.0.5",
Expand Down Expand Up @@ -147,4 +152,4 @@
"gifsicle": "5.2.0"
},
"packageManager": "[email protected]"
}
}
Loading