Skip to content

Commit

Permalink
Updated desktop release build commands and actions
Browse files Browse the repository at this point in the history
  • Loading branch information
albbus-stack committed May 23, 2024
1 parent b08afd6 commit 3da2abb
Show file tree
Hide file tree
Showing 12 changed files with 82 additions and 34 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/build-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ on:
# - main
# paths:
# - "api/**"
# - "common/**"
# pull_request:
# branches:
# - main
# paths:
# - "api/**"
# - "common/**"
workflow_dispatch:

jobs:
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/deploy-api.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/deploy-web.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Deploy Web App

on:
# push:
# branches:
# - main
push:
branches:
- main
# pull_request:
# branches:
# - main
Expand Down
35 changes: 31 additions & 4 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/**/*
35 changes: 31 additions & 4 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/
2 changes: 1 addition & 1 deletion Cargo.desktop.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
14 changes: 3 additions & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 0 additions & 3 deletions Dioxus.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,3 @@ script = []
[web.resource.dev]

script = []

[bundle]
resources = ["main.css", "./out/tailwind.css"]
Binary file added icons/icon.ico
Binary file not shown.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down

0 comments on commit 3da2abb

Please sign in to comment.