Skip to content

Commit

Permalink
feat: add trin-desktop & github action
Browse files Browse the repository at this point in the history
  • Loading branch information
njgheorghita committed Oct 29, 2024
1 parent 3fc5130 commit 64eacf2
Show file tree
Hide file tree
Showing 146 changed files with 22,173 additions and 0 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/desktop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Desktop

on: [pull_request]

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 }}
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/*
cache: 'npm'
# Specify the directory where package.json is located
cache-dependency-path: './trin-desktop/package.json'

- 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: './trin-desktop/src-tauri -> target'

- name: install frontend dependencies
# If you don't have `beforeBuildCommand` configured you may want to build your frontend here too.
run: npm install
working-directory: ./trin-desktop

- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
projectPath: './trin-desktop'
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: true
args: ${{ matrix.args }}
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ members = [
"trin-beacon",
"trin-evm",
"trin-execution",
"trin-desktop/src-tauri",
"trin-history",
"trin-state",
"trin-storage",
Expand Down
10 changes: 10 additions & 0 deletions trin-desktop/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Tauri + Vue 3

This template should help get you started developing with Tauri + Vue 3 in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.

## Dev...

- `npm install`
- `npm run tauri dev`
- `npm run lint` (optional)
- `https://www.shadcn-vue.com/docs/introduction.html` for all the js components
18 changes: 18 additions & 0 deletions trin-desktop/components.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"$schema": "https://shadcn-vue.com/schema.json",
"style": "new-york",
"typescript": false,
"tsConfigPath": "./jsconfig.json",
"tailwind": {
"config": "tailwind.config.js",
"css": "src/assets/index.css",
"baseColor": "slate",
"cssVariables": true,
"prefix": ""
},
"framework": "vite",
"aliases": {
"components": "@/components",
"utils": "@/lib/utils"
}
}
8 changes: 8 additions & 0 deletions trin-desktop/eslint.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// .eslintrc.cjs
module.exports = {
rules: {
'vue/multi-word-component-names': 'off',
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off'
}
}
14 changes: 14 additions & 0 deletions trin-desktop/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Trin Desktop App</title>
</head>

<body>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
</body>
</html>
13 changes: 13 additions & 0 deletions trin-desktop/jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
},
"target": "es2020",
"module": "esnext",
"moduleResolution": "node",
"jsx": "preserve"
},
"exclude": ["node_modules", "dist"]
}
Loading

0 comments on commit 64eacf2

Please sign in to comment.