Skip to content

Commit

Permalink
Tauri App
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderson1993 committed Jan 26, 2025
1 parent 2b8fa2c commit 1f8c807
Show file tree
Hide file tree
Showing 76 changed files with 7,374 additions and 2,301 deletions.
124 changes: 67 additions & 57 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,90 +12,100 @@ jobs:
steps:
- name: Check out Git repository
uses: actions/checkout@v4
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v4
with:
node-version: 18
- uses: oven-sh/setup-bun@v2
- name: Install Dependencies
run: npm install
run: bun install
- name: Release
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
run: bunx semantic-release
- name: Archive production artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: dist
- name: Archive other artifacts
uses: actions/upload-artifact@v4
with:
name: desktop
path: desktop
- name: Archive package.json
uses: actions/upload-artifact@v4
with:
name: package
path: package.json
name: build
path: build
release:
runs-on: ${{ matrix.os }}
needs: build
permissions:
contents: write
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest]

include:
- platform: 'macos-latest' # for Arm based macs (M1 and above).
args: '--target aarch64-apple-darwin'
arch: 'aarch64-apple-darwin'
- platform: 'macos-latest' # for Intel based macs.
args: '--target x86_64-apple-darwin'
arch: 'x86_64-apple-darwin'
- platform: 'ubuntu-22.04' # for Tauri v1 you could replace this with ubuntu-20.04.
args: ''
arch: 'x86_64-unknown-linux-gnu'
- platform: 'windows-latest'
args: ''
arch: 'x86_64-pc-windows-msvc'
steps:
- name: Check out Git repository
uses: actions/checkout@v4
with:
ref: ${{env.GITHUB_REF}}
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v4
with:
node-version: 18
- name: Download production artifacts
uses: actions/download-artifact@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
# 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: install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
name: dist
path: dist
- name: Download other artifacts
uses: actions/download-artifact@v4
# 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:
name: desktop
path: desktop
- name: Remove old package.json
run: rm package.json
- name: Download package
workspaces: './src-tauri -> target'

- uses: oven-sh/setup-bun@v2
- name: Install Dependencies
run: bun install
- name: Download production artifacts
uses: actions/download-artifact@v4
with:
name: package
path: "."
name: build
path: build
- name: Build Bun Server
run: BUILD_ARCH=${{ matrix.settings.arch}} bun run build:server
- name: Prepare for app notarization
if: startsWith(matrix.os, 'macos')
# Import Apple API key for app notarization on macOS
run: |
mkdir -p ~/private_keys/
echo '${{ secrets.api_key }}' > ~/private_keys/AuthKey_${{ secrets.api_key_id }}.p8
- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# Signing
APPLE_CERTIFICATE: ${{ secrets.MAC_CERTS }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.MAC_CERTS_PASSWORD }}
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}

- name: Build/release Electron app
uses: samuelmeuli/action-electron-builder@v1
if: always()
# Notarization
APPLE_API_ISSUER: ${{ secrets.API_KEY_ISSUER_ID }}
APPLE_API_KEY: ${{ secrets.api_key_id }}
APPLE_API_KEY_PATH: ~/private_keys/AuthKey_${{ secrets.api_key_id }}.p8

APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
with:
# GitHub token, automatically provided to the action
# (No need to define this secret in the repo settings)
github_token: ${{ secrets.GITHUB_TOKEN }}
mac_certs: ${{ secrets.MAC_CERTS }}
mac_certs_password: ${{ secrets.MAC_CERTS_PASSWORD }}
# Don't worry about running the build, just use electron-builder
skip_build: true
# If the commit is tagged with a version (e.g. "1.0.0"),
# release the app after building
release: true
env:
# macOS notarization
APPLE_API_KEY_ID: ${{ secrets.API_KEY_ID }}
APPLE_API_KEY_ISSUER: ${{ secrets.API_KEY_ISSUER_ID }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
tagName: __VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version.
releaseName: '__VERSION__'
releaseBody: 'See the assets to download this version and install.'
releaseDraft: true
prerelease: false
args: ${{ matrix.settings.args }}
- name: Setup tmate session
uses: mxschmitt/action-tmate@v2
if: failure()
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,15 @@ icons/sprite.svg
# React Router
/.react-router/
/build/

# Generated by Cargo
# will have compiled files and executables
/src-tauri/target/

# Generated by Tauri
# will have schema files for capabilities auto-completion
/src-tauri/gen/schemas

# Binaries are automatically generated
!/src-tauri/binaries/.gitkeep
/src-tauri/binaries/*
68 changes: 32 additions & 36 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -1,38 +1,34 @@
{
"branches": [
"main",
{
"name": "alpha",
"channel": "alpha",
"prerelease": true
}
],
"tagFormat": "${version}",
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"@semantic-release/changelog",
{
"changelogTitle": "# Changelog\n\nAll notable changes to this project will be documented in this file. See\n[Conventional Commits](https://conventionalcommits.org) for commit guidelines."
}
],
"@semantic-release/npm",
[
"@semantic-release/exec",
{
"publishCmd": "npm run build"
}
],
[
"@semantic-release/git",
{
"assets": [
"CHANGELOG.md",
"package.json"
],
"message": "chore(release): ${nextRelease.version}\n\n${nextRelease.notes}"
}
]
]
"branches": [
"main",
{
"name": "alpha",
"channel": "alpha",
"prerelease": true
}
],
"tagFormat": "${version}",
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"@semantic-release/changelog",
{
"changelogTitle": "# Changelog\n\nAll notable changes to this project will be documented in this file. See\n[Conventional Commits](https://conventionalcommits.org) for commit guidelines."
}
],
[
"@semantic-release/exec",
{
"publishCmd": "bun run build:client"
}
],
[
"@semantic-release/git",
{
"assets": ["CHANGELOG.md", "package.json"],
"message": "chore(release): ${nextRelease.version}\n\n${nextRelease.notes}"
}
]
]
}
2 changes: 0 additions & 2 deletions server-old/API.md → SERVER_API.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

- `PORT` - Set the port for the HTTP server. Useful for headless setups.
Defaults to 4444. The HTTPS server with use the port + 1, defaulting to 4445.
- `COOKIE_SECRET` - A secret key used to encrypt secure cookies. This is
currently unused.
- `THORIUM_PATH` - The directory that will contain the data and assets for
Thorium. Defaults to the "thorium-nova" folder in the user's Documents folder,
eg "~/Documents/thorium-nova"
Expand Down
32 changes: 32 additions & 0 deletions bun.lock
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
"@seregpie/three.text-texture": "^3.2.1",
"@tanstack/react-query": "^5.64.2",
"@tanstack/react-query-devtools": "^5.64.2",
"@tauri-apps/api": "^2.2.0",
"@tauri-apps/plugin-opener": "^2.2.5",
"@tauri-apps/plugin-shell": "^2.2.0",
"@thorium-sim/rapier3d-node": "^0.13.2",
"@use-gesture/react": "^10.3.1",
"browser-tab-id": "^0.0.8",
Expand Down Expand Up @@ -75,6 +78,7 @@
"@tailwindcss/container-queries": "^0.1.1",
"@tailwindcss/postcss": "^0.0.0-development.1",
"@tailwindcss/typography": "^0.5.16",
"@tauri-apps/cli": "^2.2.7",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^14.4.3",
"@types/bun": "^1.1.17",
Expand Down Expand Up @@ -726,6 +730,34 @@

"@tanstack/virtual-core": ["@tanstack/[email protected]", "", {}, "sha512-vTtpNt7mKCiZ1pwU9hfKPhpdVO2sVzFQsxoVBGtOSHxlrRRzYr8iQ2TlwbAcRYCcEiZ9ECAM8kBzH0v2+VzfKw=="],

"@tauri-apps/api": ["@tauri-apps/[email protected]", "", {}, "sha512-R8epOeZl1eJEl603aUMIGb4RXlhPjpgxbGVEaqY+0G5JG9vzV/clNlzTeqc+NLYXVqXcn8mb4c5b9pJIUDEyAg=="],

"@tauri-apps/cli": ["@tauri-apps/[email protected]", "", { "optionalDependencies": { "@tauri-apps/cli-darwin-arm64": "2.2.7", "@tauri-apps/cli-darwin-x64": "2.2.7", "@tauri-apps/cli-linux-arm-gnueabihf": "2.2.7", "@tauri-apps/cli-linux-arm64-gnu": "2.2.7", "@tauri-apps/cli-linux-arm64-musl": "2.2.7", "@tauri-apps/cli-linux-x64-gnu": "2.2.7", "@tauri-apps/cli-linux-x64-musl": "2.2.7", "@tauri-apps/cli-win32-arm64-msvc": "2.2.7", "@tauri-apps/cli-win32-ia32-msvc": "2.2.7", "@tauri-apps/cli-win32-x64-msvc": "2.2.7" }, "bin": { "tauri": "tauri.js" } }, "sha512-ZnsS2B4BplwXP37celanNANiIy8TCYhvg5RT09n72uR/o+navFZtGpFSqljV8fy1Y4ixIPds8FrGSXJCN2BerA=="],

"@tauri-apps/cli-darwin-arm64": ["@tauri-apps/[email protected]", "", { "os": "darwin", "cpu": "arm64" }, "sha512-54kcpxZ3X1Rq+pPTzk3iIcjEVY4yv493uRx/80rLoAA95vAC0c//31Whz75UVddDjJfZvXlXZ3uSZ+bnCOnt0A=="],

"@tauri-apps/cli-darwin-x64": ["@tauri-apps/[email protected]", "", { "os": "darwin", "cpu": "x64" }, "sha512-Vgu2XtBWemLnarB+6LqQeLanDlRj7CeFN//H8bVVdjbNzxcSxsvbLYMBP8+3boa7eBnjDrqMImRySSgL6IrwTw=="],

"@tauri-apps/cli-linux-arm-gnueabihf": ["@tauri-apps/[email protected]", "", { "os": "linux", "cpu": "arm" }, "sha512-+Clha2iQAiK9zoY/KKW0KLHkR0k36O78YLx5Sl98tWkwI3OBZFg5H5WT1plH/4sbZIS2aLFN6dw58/JlY9Bu/g=="],

"@tauri-apps/cli-linux-arm64-gnu": ["@tauri-apps/[email protected]", "", { "os": "linux", "cpu": "arm64" }, "sha512-Z/Lp4SQe6BUEOays9BQAEum2pvZF4w9igyXijP+WbkOejZx4cDvarFJ5qXrqSLmBh7vxrdZcLwoLk9U//+yQrg=="],

"@tauri-apps/cli-linux-arm64-musl": ["@tauri-apps/[email protected]", "", { "os": "linux", "cpu": "arm64" }, "sha512-+8HZ+txff/Y3YjAh80XcLXcX8kpGXVdr1P8AfjLHxHdS6QD4Md+acSxGTTNbplmHuBaSHJvuTvZf9tU1eDCTDg=="],

"@tauri-apps/cli-linux-x64-gnu": ["@tauri-apps/[email protected]", "", { "os": "linux", "cpu": "x64" }, "sha512-ahlSnuCnUntblp9dG7/w5ZWZOdzRFi3zl0oScgt7GF4KNAOEa7duADsxPA4/FT2hLRa0SvpqtD4IYFvCxoVv3Q=="],

"@tauri-apps/cli-linux-x64-musl": ["@tauri-apps/[email protected]", "", { "os": "linux", "cpu": "x64" }, "sha512-+qKAWnJRSX+pjjRbKAQgTdFY8ecdcu8UdJ69i7wn3ZcRn2nMMzOO2LOMOTQV42B7/Q64D1pIpmZj9yblTMvadA=="],

"@tauri-apps/cli-win32-arm64-msvc": ["@tauri-apps/[email protected]", "", { "os": "win32", "cpu": "arm64" }, "sha512-aa86nRnrwT04u9D9fhf5JVssuAZlUCCc8AjqQjqODQjMd4BMA2+d4K9qBMpEG/1kVh95vZaNsLogjEaqSTTw4A=="],

"@tauri-apps/cli-win32-ia32-msvc": ["@tauri-apps/[email protected]", "", { "os": "win32", "cpu": "ia32" }, "sha512-EiJ5/25tLSQOSGvv+t6o3ZBfOTKB5S3vb+hHQuKbfmKdRF0XQu2YPdIi1CQw1DU97ZAE0Dq4frvnyYEKWgMzVQ=="],

"@tauri-apps/cli-win32-x64-msvc": ["@tauri-apps/[email protected]", "", { "os": "win32", "cpu": "x64" }, "sha512-ZB8Kw90j8Ld+9tCWyD2fWCYfIrzbQohJ4DJSidNwbnehlZzP7wAz6Z3xjsvUdKtQ3ibtfoeTqVInzCCEpI+pWg=="],

"@tauri-apps/plugin-opener": ["@tauri-apps/[email protected]", "", { "dependencies": { "@tauri-apps/api": "^2.0.0" } }, "sha512-hHsJ9RPWpZvZEPVFaL+d25gABMUMOf/A6ESXnvf/ii9guTukj58WXsAE/SOysXRIhej7kseRCxnOnIMpSCdUsQ=="],

"@tauri-apps/plugin-shell": ["@tauri-apps/[email protected]", "", { "dependencies": { "@tauri-apps/api": "^2.0.0" } }, "sha512-iC3Ic1hLmasoboG7BO+7p+AriSoqAwKrIk+Hpk+S/bjTQdXqbl2GbdclghI4gM32X0bls7xHzIFqhRdrlvJeaA=="],

"@testing-library/dom": ["@testing-library/[email protected]", "", { "dependencies": { "@babel/code-frame": "^7.10.4", "@babel/runtime": "^7.12.5", "@types/aria-query": "^5.0.1", "aria-query": "5.1.3", "chalk": "^4.1.0", "dom-accessibility-api": "^0.5.9", "lz-string": "^1.5.0", "pretty-format": "^27.0.2" } }, "sha512-/DiOQ5xBxgdYRC8LNk7U+RWat0S3qRLeIw3ZIkMQ9kkVlRmwD/Eg8k8CqIpD6GW7u20JIUOfMKbxtiLutpjQ4g=="],

"@testing-library/react": ["@testing-library/[email protected]", "", { "dependencies": { "@babel/runtime": "^7.12.5", "@testing-library/dom": "^8.5.0", "@types/react-dom": "^18.0.0" }, "peerDependencies": { "react": "^18.0.0", "react-dom": "^18.0.0" } }, "sha512-sXOGON+WNTh3MLE9rve97ftaZukN3oNf2KjDy7YTx6hcTO2uuLHuCGynMDhFwGw/jYf4OJ2Qk0i4i79qMNNkyw=="],
Expand Down
Loading

0 comments on commit 1f8c807

Please sign in to comment.