Skip to content

Commit e24c6e8

Browse files
Merge pull request #25 from Keshav-writes-code/staging
Major Improvements
2 parents 9bd5dd2 + a64c7a0 commit e24c6e8

285 files changed

Lines changed: 10240 additions & 1057 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build.yaml

Lines changed: 0 additions & 69 deletions
This file was deleted.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- 'apps/site/**'
8+
- '.github/workflows/deploy-website.yml'
9+
10+
workflow_dispatch:
11+
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-slim
20+
steps:
21+
- name: Checkout your repository using git
22+
uses: actions/checkout@v5
23+
- name: Install, build, and upload your site
24+
uses: withastro/action@v5
25+
with:
26+
path: 'apps/site'
27+
node-version: 24
28+
package-manager: pnpm@latest
29+
build-cmd: pnpm run build
30+
31+
deploy:
32+
needs: build
33+
runs-on: ubuntu-slim
34+
environment:
35+
name: github-pages
36+
url: ${{ steps.deployment.outputs.page_url }}
37+
steps:
38+
- name: Deploy to GitHub Pages
39+
id: deployment
40+
uses: actions/deploy-pages@v4
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
name: 'tauri-build-debug'
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
- staging
9+
- main
10+
paths:
11+
- 'apps/app/**'
12+
- '.github/workflows/tauri-build-debug.yml'
13+
workflow_dispatch:
14+
15+
jobs:
16+
publish-tauri:
17+
environment: production
18+
permissions:
19+
contents: write
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
include:
24+
- platform: 'macos-latest' # for Arm based macs (M1 and above).
25+
args: '--target aarch64-apple-darwin --debug'
26+
- platform: 'macos-latest' # for Intel based macs.
27+
args: '--target x86_64-apple-darwin --debug'
28+
- platform: 'ubuntu-22.04'
29+
args: '--debug'
30+
- platform: 'ubuntu-22.04-arm'
31+
args: '--debug'
32+
- platform: 'windows-2022'
33+
args: '--debug'
34+
- platform: 'windows-11-arm'
35+
args: '--debug'
36+
- platform: 'ubuntu-22.04'
37+
args: '--apk true --split-per-abi --target aarch64 --target armv7 --debug'
38+
mobile: 'android'
39+
runs-on: ${{ matrix.platform }}
40+
steps:
41+
# ------------ Git Clone ----------------
42+
- uses: actions/checkout@v6
43+
44+
# ------------ Desktop OS ----------------
45+
- name: Free up disk space on Linux runners
46+
uses: mathio/gha-cleanup@v1
47+
if: startsWith(matrix.platform, 'ubuntu')
48+
with:
49+
remove-browsers: true
50+
verbose: true
51+
- name: Fix Android Directory Permissions
52+
if: startsWith(matrix.platform, 'ubuntu')
53+
run: |
54+
sudo mkdir -p /usr/local/lib/android
55+
sudo chown -R $USER:$USER /usr/local/lib/android
56+
- name: install dependencies (ubuntu only)
57+
if: startsWith(matrix.platform, 'ubuntu')
58+
run: |
59+
sudo apt-get update
60+
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev xdg-utils
61+
62+
# ------------- Node -------------
63+
- name: setup node
64+
uses: actions/setup-node@v4
65+
with:
66+
node-version: lts/*
67+
- name: setup bun
68+
uses: oven-sh/setup-bun@v2
69+
- name: install frontend dependencies
70+
if: matrix.platform != 'windows-11-arm'
71+
run: bun i
72+
- name: install frontend dependencies (Windows ARM)
73+
if: matrix.platform == 'windows-11-arm'
74+
run: npm install
75+
76+
# ------------- Rust -------------
77+
- name: install Rust stable (desktop)
78+
if: matrix.mobile == ''
79+
uses: dtolnay/rust-toolchain@stable
80+
with:
81+
targets: aarch64-apple-darwin,x86_64-apple-darwin
82+
- name: install Rust stable (android)
83+
if: matrix.mobile == 'android'
84+
uses: dtolnay/rust-toolchain@stable
85+
with:
86+
targets: aarch64-linux-android,armv7-linux-androideabi,i686-linux-android,x86_64-linux-android
87+
- uses: Swatinem/rust-cache@v2
88+
with:
89+
cache-on-failure: true
90+
workspaces: apps/app/src-tauri/ -> target
91+
92+
# ------------- Android -------------
93+
- name: Set up JDK
94+
if: matrix.mobile == 'android'
95+
uses: actions/setup-java@v5
96+
with:
97+
java-version: '17' # Maybe 17
98+
distribution: 'temurin'
99+
- name: Setup Android SDK
100+
if: matrix.mobile == 'android'
101+
uses: android-actions/setup-android@v3
102+
- name: Setup Android NDK
103+
if: matrix.mobile == 'android'
104+
uses: nttld/setup-ndk@v1
105+
id: setup-ndk
106+
with:
107+
ndk-version: r29
108+
link-to-sdk: true
109+
- name: setup Android signing
110+
if: matrix.mobile == 'android'
111+
run: |
112+
cd apps/app/src-tauri/gen/android
113+
echo "keyAlias=${{ secrets.ANDROID_KEY_ALIAS }}" > keystore.properties
114+
echo "password=${{ secrets.ANDROID_KEY_PASSWORD }}" >> keystore.properties
115+
base64 -d <<< "${{ secrets.ANDROID_KEY_BASE64 }}" > $RUNNER_TEMP/keystore.jks
116+
echo "storeFile=$RUNNER_TEMP/keystore.jks" >> keystore.properties
117+
118+
# ---------------- Tauri -----------------
119+
- name: Build Tauri Project
120+
uses: tauri-apps/tauri-action@e3ec38d49ea445df6d61ebaf015a85b1846b63f3
121+
env:
122+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
123+
NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
124+
with:
125+
projectPath: 'apps/app'
126+
uploadWorkflowArtifacts: true
127+
workflowArtifactNamePattern: '[name]-v[version]-[platform]-[arch]-[mode][ext]'
128+
args: ${{ matrix.args }}
129+
mobile: ${{ matrix.mobile }}
Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
name: 'tauri-build-release'
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
- staging
9+
paths:
10+
- 'apps/app/**'
11+
- '.github/workflows/tauri-build-release.yml'
12+
workflow_dispatch:
13+
14+
jobs:
15+
publish-tauri:
16+
environment: production
17+
permissions:
18+
contents: write
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
include:
23+
- platform: 'macos-latest' # for Arm based macs (M1 and above).
24+
args: '--target aarch64-apple-darwin'
25+
- platform: 'macos-latest' # for Intel based macs.
26+
args: '--target x86_64-apple-darwin'
27+
- platform: 'ubuntu-22.04'
28+
args: ''
29+
- platform: 'ubuntu-22.04-arm'
30+
args: ''
31+
- platform: 'windows-2022'
32+
args: ''
33+
- platform: 'windows-11-arm'
34+
args: ''
35+
- platform: 'ubuntu-22.04'
36+
args: '--apk true --split-per-abi --target aarch64 --target armv7'
37+
mobile: 'android'
38+
runs-on: ${{ matrix.platform }}
39+
steps:
40+
- uses: actions/checkout@v6
41+
42+
# ------------- Node & Frontend Cache -------------
43+
- name: setup node
44+
uses: actions/setup-node@v4
45+
with:
46+
node-version: lts/*
47+
48+
- name: setup bun
49+
uses: oven-sh/setup-bun@v2
50+
51+
# NEW: Cache Bun dependencies
52+
- name: Cache Bun dependencies
53+
uses: actions/cache@v4
54+
with:
55+
path: ~/.bun/install/cache
56+
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }}
57+
restore-keys: |
58+
${{ runner.os }}-bun-
59+
60+
# Case 1: Run bun for everything EXCEPT Windows ARM
61+
- name: install frontend dependencies
62+
if: matrix.platform != 'windows-11-arm'
63+
run: bun i
64+
65+
# Case 2: Run npm ONLY for Windows ARM
66+
- name: install frontend dependencies (Windows ARM)
67+
if: matrix.platform == 'windows-11-arm'
68+
run: npm install
69+
70+
# ------------- Rust & Cargo Cache -------------
71+
- name: install Rust stable (desktop)
72+
if: matrix.mobile == ''
73+
uses: dtolnay/rust-toolchain@stable
74+
with:
75+
targets: aarch64-apple-darwin,x86_64-apple-darwin
76+
77+
- name: install Rust stable (android)
78+
if: matrix.mobile == 'android'
79+
uses: dtolnay/rust-toolchain@stable
80+
with:
81+
targets: aarch64-linux-android,armv7-linux-androideabi,i686-linux-android,x86_64-linux-android
82+
83+
# MODIFIED: Fixed workspaces syntax and ensured shared key matches matrix
84+
- uses: Swatinem/rust-cache@v2
85+
with:
86+
cache-on-failure: true
87+
# Point this to the folder containing Cargo.toml.
88+
# The action automatically handles the 'target' directory.
89+
workspaces: apps/app/src-tauri
90+
# Adding a key based on the job matrix helps prevent cache conflicts between platforms
91+
key: ${{ matrix.platform }}-${{ matrix.args }}
92+
93+
# ------------- Android -------------
94+
- name: Set up JDK
95+
if: matrix.mobile == 'android'
96+
uses: actions/setup-java@v5
97+
with:
98+
java-version: '17'
99+
distribution: 'temurin'
100+
101+
# NEW: Cache Gradle for Android
102+
- name: Cache Gradle
103+
if: matrix.mobile == 'android'
104+
uses: actions/cache@v4
105+
with:
106+
path: |
107+
~/.gradle/caches
108+
~/.gradle/wrapper
109+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
110+
restore-keys: |
111+
${{ runner.os }}-gradle-
112+
113+
- name: Setup Android SDK
114+
if: matrix.mobile == 'android'
115+
uses: android-actions/setup-android@v3
116+
- name: Setup Android NDK
117+
if: matrix.mobile == 'android'
118+
uses: nttld/setup-ndk@v1
119+
id: setup-ndk
120+
with:
121+
ndk-version: r29
122+
link-to-sdk: true
123+
- name: setup Android signing
124+
if: matrix.mobile == 'android'
125+
run: |
126+
cd apps/app/src-tauri/gen/android
127+
echo "keyAlias=${{ secrets.ANDROID_KEY_ALIAS }}" > keystore.properties
128+
echo "password=${{ secrets.ANDROID_KEY_PASSWORD }}" >> keystore.properties
129+
base64 -d <<< "${{ secrets.ANDROID_KEY_BASE64 }}" > $RUNNER_TEMP/keystore.jks
130+
echo "storeFile=$RUNNER_TEMP/keystore.jks" >> keystore.properties
131+
132+
# ------------ Desktop OS ----------------
133+
- name: install dependencies (ubuntu only)
134+
if: startsWith(matrix.platform, 'ubuntu')
135+
run: |
136+
sudo apt-get update
137+
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev xdg-utils
138+
139+
# ---------------- Tauri -----------------
140+
- name: Build Tauri Project
141+
uses: tauri-apps/tauri-action@e3ec38d49ea445df6d61ebaf015a85b1846b63f3
142+
env:
143+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
144+
NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
145+
with:
146+
projectPath: 'apps/app'
147+
tagName: cherit-v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version.
148+
releaseName: 'Cherit v__VERSION__'
149+
releaseAssetNamePattern: '[name]-[platform]-[arch][ext]'
150+
releaseBody: 'See the assets to download this version and install.'
151+
releaseDraft: true
152+
prerelease: false
153+
args: ${{ matrix.args }}
154+
mobile: ${{ matrix.mobile }}

0 commit comments

Comments
 (0)