diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 9252f45..a687619 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -23,7 +23,8 @@ jobs: profile: minimal toolchain: stable - - uses: Swatinem/rust-cache@v2 + - name: Cache Rust dependencies + uses: Swatinem/rust-cache@v2 - name: Build run: mv Cargo.toml Cargo.toml.bak && cp Cargo.mobile.toml Cargo.toml && cargo android apk build --release --split-per-abi diff --git a/.github/workflows/build-api.yml b/.github/workflows/build-api.yml index 1ba9db5..a643fb1 100644 --- a/.github/workflows/build-api.yml +++ b/.github/workflows/build-api.yml @@ -6,11 +6,13 @@ on: # - main # paths: # - "api/**" + # - "common/**" # pull_request: # branches: # - main # paths: # - "api/**" + # - "common/**" workflow_dispatch: jobs: diff --git a/.github/workflows/deploy-api.yml b/.github/workflows/deploy-api.yml index 61dfeed..df574ad 100644 --- a/.github/workflows/deploy-api.yml +++ b/.github/workflows/deploy-api.yml @@ -1,16 +1,18 @@ name: Deploy API on: - # push: - # branches: - # - main - # paths: - # - "api/**" + push: + branches: + - main + paths: + - "api/**" + - "common/**" # pull_request: # branches: # - main # paths: # - "api/**" + # - "common/**" workflow_dispatch: jobs: diff --git a/.github/workflows/deploy-web.yml b/.github/workflows/deploy-web.yml index fe94f2c..20e2d5b 100644 --- a/.github/workflows/deploy-web.yml +++ b/.github/workflows/deploy-web.yml @@ -1,9 +1,9 @@ name: Deploy Web App on: - # push: - # branches: - # - main + push: + branches: + - main # pull_request: # branches: # - main diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 01623d7..d75a9e0 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -23,16 +23,43 @@ jobs: profile: minimal toolchain: stable - - uses: Swatinem/rust-cache@v2 + - name: Cache Rust dependencies + uses: Swatinem/rust-cache@v2 - name: Install development dependencies run: sudo apt-get install -y libgtk-3-dev + - name: Install Bun + uses: oven-sh/setup-bun@v1 + with: + bun-version: latest + + - name: Install Bun dependencies + run: bun install --frozen-lockfile + + - name: Generate TailwindCSS + run: bun build:tailwind + + - name: Install Dioxus CLI + run: cargo install dioxus-cli + + - name: Create .cargo/config.toml file + run: mkdir .cargo && printf "[profile.release]\nopt-level = \"z\"\ndebug = false\nlto = true\ncodegen-units = 1\npanic = \"abort\"\nstrip = true\nincremental = false\n" > .cargo/config.toml + + - name: Create .env file + env: + API_URL: ${{ secrets.API_URL }} + SUPABASE_URL: ${{ secrets.SUPABASE_URL }} + SUPABASE_API_KEY: ${{ secrets.SUPABASE_API_KEY }} + SUPABASE_JWT_SECRET: ${{ secrets.SUPABASE_JWT_SECRET }} + DATABASE_URL: ${{ secrets.DATABASE_URL }} + run: printf "API_URL=$API_URL\nSUPABASE_URL=$SUPABASE_URL\nSUPABASE_API_KEY=$SUPABASE_API_KEY\nSUPABASE_JWT_SECRET=$SUPABASE_JWT_SECRET\nDATABASE_URL=$DATABASE_URL\n" > .env + - name: Build - run: mv Cargo.toml Cargo.toml.bak && cp Cargo.desktop.toml Cargo.toml && cargo build --release --platform desktop + run: mv Cargo.toml Cargo.toml.bak && cp Cargo.desktop.toml Cargo.toml && WEBKIT_DISABLE_COMPOSITING_MODE=1 dx bundle --platform desktop --release - name: Upload artifact uses: actions/upload-artifact@v4 with: - name: web - path: target/dist/t5-rs-desktop + name: linux + path: dist/bundle/deb/**/* diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 73f481d..83902ac 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -23,13 +23,40 @@ jobs: profile: minimal toolchain: stable - - uses: Swatinem/rust-cache@v2 + - name: Cache Rust dependencies + uses: Swatinem/rust-cache@v2 + + - name: Install Bun + uses: oven-sh/setup-bun@v1 + with: + bun-version: latest + + - name: Install Bun dependencies + run: bun install --frozen-lockfile + + - name: Generate TailwindCSS + run: bun build:tailwind + + - name: Install Dioxus CLI + run: cargo install dioxus-cli + + - name: Create .cargo/config.toml file + run: mkdir .cargo && printf "[profile.release]\nopt-level = \"z\"\ndebug = false\nlto = true\ncodegen-units = 1\npanic = \"abort\"\nstrip = true\nincremental = false\n" > .cargo/config.toml + + - name: Create .env file + env: + API_URL: ${{ secrets.API_URL }} + SUPABASE_URL: ${{ secrets.SUPABASE_URL }} + SUPABASE_API_KEY: ${{ secrets.SUPABASE_API_KEY }} + SUPABASE_JWT_SECRET: ${{ secrets.SUPABASE_JWT_SECRET }} + DATABASE_URL: ${{ secrets.DATABASE_URL }} + run: printf "API_URL=$API_URL\nSUPABASE_URL=$SUPABASE_URL\nSUPABASE_API_KEY=$SUPABASE_API_KEY\nSUPABASE_JWT_SECRET=$SUPABASE_JWT_SECRET\nDATABASE_URL=$DATABASE_URL\n" > .env - name: Build - run: mv Cargo.toml Cargo.toml.bak && cp Cargo.desktop.toml Cargo.toml && cargo build --release --platform desktop + run: mv Cargo.toml Cargo.toml.bak && cp Cargo.desktop.toml Cargo.toml && dx bundle --platform desktop --release - name: Upload artifact uses: actions/upload-artifact@v4 with: - name: web - path: target/dist/t5-rs-desktop.exe + name: windows + path: dist/bundle/msi/ diff --git a/Cargo.desktop.toml b/Cargo.desktop.toml index 94f7b63..a1726fa 100644 --- a/Cargo.desktop.toml +++ b/Cargo.desktop.toml @@ -46,7 +46,7 @@ dotenvy = "0.15.7" dotenvy_macro = "0.15.7" common = { path = "common" } -dioxus = { version = "0.5", features = ["mobile"] } +dioxus = { version = "0.5", features = ["desktop"] } [target.'cfg(target_os = "android")'.dependencies] android_logger = "0.13" diff --git a/Cargo.lock b/Cargo.lock index 62e7eac..3e96544 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -944,11 +944,11 @@ dependencies = [ "dioxus-config-macro", "dioxus-core", "dioxus-core-macro", + "dioxus-desktop", "dioxus-fullstack", "dioxus-hooks", "dioxus-hot-reload", "dioxus-html", - "dioxus-mobile", "dioxus-signals", ] @@ -1024,6 +1024,7 @@ dependencies = [ "dioxus-cli-config", "dioxus-core", "dioxus-hooks", + "dioxus-hot-reload", "dioxus-html", "dioxus-interpreter-js", "dunce", @@ -1060,9 +1061,9 @@ dependencies = [ "base64 0.21.7", "bytes", "ciborium", + "dioxus-desktop", "dioxus-hot-reload", "dioxus-lib", - "dioxus-mobile", "dioxus_server_macro", "futures-util", "once_cell", @@ -1169,15 +1170,6 @@ dependencies = [ "dioxus-signals", ] -[[package]] -name = "dioxus-mobile" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5288827dfd5fba0b21ec23679988c7c7609bbd94ae4f0fa5de2976da580f3378" -dependencies = [ - "dioxus-desktop", -] - [[package]] name = "dioxus-rsx" version = "0.5.1" diff --git a/Cargo.toml b/Cargo.toml index 94f7b63..a1726fa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -46,7 +46,7 @@ dotenvy = "0.15.7" dotenvy_macro = "0.15.7" common = { path = "common" } -dioxus = { version = "0.5", features = ["mobile"] } +dioxus = { version = "0.5", features = ["desktop"] } [target.'cfg(target_os = "android")'.dependencies] android_logger = "0.13" diff --git a/Dioxus.toml b/Dioxus.toml index 83bd5e5..1c8bebd 100644 --- a/Dioxus.toml +++ b/Dioxus.toml @@ -22,6 +22,3 @@ script = [] [web.resource.dev] script = [] - -[bundle] -resources = ["main.css", "./out/tailwind.css"] diff --git a/icons/icon.ico b/icons/icon.ico new file mode 100644 index 0000000..eed0c09 Binary files /dev/null and b/icons/icon.ico differ diff --git a/package.json b/package.json index a85ecd7..598d287 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "build:api": "cd api && cargo build --release", "build:web": "mv Cargo.toml Cargo.toml.bak && cp Cargo.web.toml Cargo.toml && dx build --platform web --release", "build:android": "mv Cargo.toml Cargo.toml.bak && cp Cargo.mobile.toml Cargo.toml && cargo android apk build --release --split-per-abi", - "build:desktop": "mv Cargo.toml Cargo.toml.bak && cp Cargo.desktop.toml Cargo.toml && dx bundle --platform desktop --release", + "build:desktop": "mv Cargo.toml Cargo.toml.bak && cp Cargo.desktop.toml Cargo.toml && WEBKIT_DISABLE_COMPOSITING_MODE=1 dx bundle --platform desktop --release", "deploy:api": "fly deploy", "lint": "cargo clippy" },