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

Tauri #78

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
64 changes: 64 additions & 0 deletions .github/workflows/tauri.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: 'tauri'

on:
workflow_dispatch:

jobs:
publish-tauri:
permissions:
contents: write
strategy:
fail-fast: false
matrix:
settings:
- 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' # for Tauri v1 you could replace this with ubuntu-20.04.
args: ''
- platform: 'windows-latest'
args: ''

runs-on: ${{ matrix.settings.platform }}
steps:
- uses: actions/checkout@v4

- name: install dependencies (ubuntu only)
if: matrix.settings.platform == 'ubuntu-22.04' # This must match the platform value defined above.
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
# webkitgtk 4.0 is for Tauri v1 - webkitgtk 4.1 is for Tauri v2.
# You can remove the one that doesn't apply to your app to speed up the workflow a bit.

- name: Set up Bun
uses: oven-sh/setup-bun@v1
- name: Bun version
run: bun --version

- name: install Rust stable
uses: dtolnay/rust-toolchain@stable
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.settings.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: bun install # change this to npm or pnpm depending on which one you use.

- 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.settings.args }}
20 changes: 20 additions & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,23 @@ bun run dev
```

Open [http://localhost:3000](http://localhost:3000) in the browser.

## Tauri

Make sure you got the [prerequisites](https://tauri.app/v1/guides/getting-started/prerequisites) to be able run tauri commands.

### Development

```bash
bunx tauri dev
```

### Build

Check the full guide [here](https://tauri.app/v1/guides/building/)

```bash
bunx tauri build
```

the resulting build can be found in `./src-tauri/target/release`
Binary file modified bun.lockb
Binary file not shown.
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"dev": "next dev",
"build": "next build",
"start": "serve out",
"tauri": "tauri",
"test:types": "tsc",
"test:units": "vitest",
"test:lint": "next lint --max-warnings=0 --format=compact",
Expand All @@ -18,6 +19,7 @@
"@radix-ui/react-radio-group": "1.1.3",
"@radix-ui/react-slider": "1.1.2",
"@radix-ui/react-switch": "1.0.3",
"@tauri-apps/api": "^1.5.6",
"clsx": "2.1.0",
"next": "14.0.4",
"react": "18.2.0",
Expand All @@ -28,6 +30,7 @@
},
"devDependencies": {
"@next/eslint-plugin-next": "14.0.4",
"@tauri-apps/cli": "^1.5.14",
"@types/node": "20.11.0",
"@types/react": "18.2.47",
"@types/react-dom": "18.2.18",
Expand Down
3 changes: 3 additions & 0 deletions src-tauri/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Generated by Cargo
# will have compiled files and executables
/target/
Loading