Skip to content
Open
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
111 changes: 16 additions & 95 deletions .github/workflows/app-build-debug-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,112 +5,33 @@ on:

jobs:
build-app-debug:
environment: production
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
- platform: 'macos-latest' # for Arm based macs (M1 and above).
args: '--target aarch64-apple-darwin --debug'
args: '--target aarch64-apple-darwin'
- platform: 'macos-latest' # for Intel based macs.
args: '--target x86_64-apple-darwin --debug'
args: '--target x86_64-apple-darwin'
- platform: 'ubuntu-22.04'
args: '--debug'
args: ''
- platform: 'ubuntu-22.04-arm'
args: '--debug'
args: ''
- platform: 'windows-2022'
args: '--debug'
args: ''
- platform: 'windows-11-arm'
args: '--debug'
args: ''
- platform: 'ubuntu-22.04'
args: '--apk --split-per-abi --target aarch64 --target armv7 --debug'
args: '--apk --split-per-abi --target aarch64 --target armv7'
mobile: 'android'
runs-on: ${{ matrix.platform }}
steps:
# ------------ Git Clone ----------------
- uses: actions/checkout@v6

# ------------ Desktop OS ----------------
- name: Free up disk space on Linux runners
uses: mathio/gha-cleanup@v1
if: startsWith(matrix.platform, 'ubuntu')
with:
remove-browsers: true
verbose: true
- name: Fix Android Directory Permissions
if: startsWith(matrix.platform, 'ubuntu')
run: |
sudo mkdir -p /usr/local/lib/android
sudo chown -R $USER:$USER /usr/local/lib/android
- name: install dependencies (ubuntu only)
if: startsWith(matrix.platform, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev xdg-utils

# ------------- Node -------------
- name: setup node
uses: actions/setup-node@v4
with:
node-version: lts/*
- name: setup bun
uses: oven-sh/setup-bun@v2
- name: install frontend dependencies
run: bun i

# ------------- Rust -------------
- name: install Rust stable (desktop)
if: matrix.mobile == ''
uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-apple-darwin,x86_64-apple-darwin
- name: install Rust stable (android)
if: matrix.mobile == 'android'
uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-linux-android,armv7-linux-androideabi,i686-linux-android,x86_64-linux-android
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
workspaces: apps/app/src-tauri/ -> target

# ------------- Android -------------
- name: Set up JDK
if: matrix.mobile == 'android'
uses: actions/setup-java@v5
with:
java-version: '17' # Maybe 17
distribution: 'temurin'
- name: Setup Android SDK
if: matrix.mobile == 'android'
uses: android-actions/setup-android@v3
- name: Setup Android NDK
if: matrix.mobile == 'android'
uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: r29
link-to-sdk: true
- name: setup Android signing
if: matrix.mobile == 'android'
run: |
cd apps/app/src-tauri/gen/android
echo "keyAlias=${{ secrets.ANDROID_KEY_ALIAS }}" > keystore.properties
echo "password=${{ secrets.ANDROID_KEY_PASSWORD }}" >> keystore.properties
base64 -d <<< "${{ secrets.ANDROID_KEY_BASE64 }}" > $RUNNER_TEMP/keystore.jks
echo "storeFile=$RUNNER_TEMP/keystore.jks" >> keystore.properties

# ---------------- Tauri -----------------
- name: Build Tauri Project
uses: tauri-apps/tauri-action@8236c82510173ef930d644f38790c4cf3fd43cf2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
with:
projectPath: 'apps/app'
uploadWorkflowArtifacts: true
workflowArtifactNamePattern: '[name]-v[version]-[platform]-[arch]-[mode][ext]'
args: ${{ matrix.args }}
mobile: ${{ matrix.mobile }}
uses: ./.github/workflows/app-build.yml
with:
build-mode: 'debug'
publish: false
environment: 'production'
platform: ${{ matrix.platform }}
args: ${{ matrix.args }}
mobile: ${{ matrix.mobile || '' }}
secrets: inherit
117 changes: 9 additions & 108 deletions .github/workflows/app-build-release-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ on:

jobs:
build-app-release:
environment: production
permissions:
contents: write
strategy:
Expand All @@ -40,110 +39,12 @@ jobs:
- platform: 'ubuntu-22.04'
args: '--apk --split-per-abi --target aarch64 --target armv7'
mobile: 'android'
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v6

# ------------- Node & Frontend Cache -------------
- name: setup node
uses: actions/setup-node@v4
with:
node-version: lts/*

- name: setup bun
uses: oven-sh/setup-bun@v2

# NEW: Cache Bun dependencies
- name: Cache Bun dependencies
uses: actions/cache@v4
with:
path: ~/.bun/install/cache
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }}
restore-keys: |
${{ runner.os }}-bun-

# Case 1: Run bun for everything EXCEPT Windows ARM
- name: install frontend dependencies
run: bun i

# ------------- Rust & Cargo Cache -------------
- name: install Rust stable (desktop)
if: matrix.mobile == ''
uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-apple-darwin,x86_64-apple-darwin

- name: install Rust stable (android)
if: matrix.mobile == 'android'
uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-linux-android,armv7-linux-androideabi,i686-linux-android,x86_64-linux-android

# MODIFIED: Fixed workspaces syntax and ensured shared key matches matrix
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
# Point this to the folder containing Cargo.toml.
# The action automatically handles the 'target' directory.
workspaces: apps/app/src-tauri
# Adding a key based on the job matrix helps prevent cache conflicts between platforms
key: ${{ matrix.platform }}-${{ matrix.args }}

# ------------- Android -------------
- name: Set up JDK
if: matrix.mobile == 'android'
uses: actions/setup-java@v5
with:
java-version: '17'
distribution: 'temurin'

# NEW: Cache Gradle for Android
- name: Cache Gradle
if: matrix.mobile == 'android'
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-

- name: Setup Android SDK
if: matrix.mobile == 'android'
uses: android-actions/setup-android@v3
- name: Setup Android NDK
if: matrix.mobile == 'android'
uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: r29
link-to-sdk: true
- name: setup Android signing
if: matrix.mobile == 'android'
run: |
cd apps/app/src-tauri/gen/android
echo "keyAlias=${{ secrets.ANDROID_KEY_ALIAS }}" > keystore.properties
echo "password=${{ secrets.ANDROID_KEY_PASSWORD }}" >> keystore.properties
base64 -d <<< "${{ secrets.ANDROID_KEY_BASE64 }}" > $RUNNER_TEMP/keystore.jks
echo "storeFile=$RUNNER_TEMP/keystore.jks" >> keystore.properties

# ------------ Desktop OS ----------------
- name: install dependencies (ubuntu only)
if: startsWith(matrix.platform, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev xdg-utils

# ---------------- Tauri -----------------
- name: Build Tauri Project
uses: tauri-apps/tauri-action@8236c82510173ef930d644f38790c4cf3fd43cf2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
with:
projectPath: 'apps/app'
uploadWorkflowArtifacts: true
workflowArtifactNamePattern: '[name]-v[version]-[platform]-[arch]-[mode][ext]'
args: ${{ matrix.args }}
mobile: ${{ matrix.mobile }}
uses: ./.github/workflows/app-build.yml
with:
build-mode: 'release'
publish: false
environment: 'production'
platform: ${{ matrix.platform }}
args: ${{ matrix.args }}
mobile: ${{ matrix.mobile || '' }}
secrets: inherit
121 changes: 9 additions & 112 deletions .github/workflows/app-build-release-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ on:

jobs:
publish-app-release:
environment: production
permissions:
contents: write
strategy:
Expand All @@ -39,114 +38,12 @@ jobs:
- platform: 'ubuntu-22.04'
args: '--apk --split-per-abi --target aarch64 --target armv7'
mobile: 'android'
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v6

# ------------- Node & Frontend Cache -------------
- name: setup node
uses: actions/setup-node@v4
with:
node-version: lts/*

- name: setup bun
uses: oven-sh/setup-bun@v2

# NEW: Cache Bun dependencies
- name: Cache Bun dependencies
uses: actions/cache@v4
with:
path: ~/.bun/install/cache
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }}
restore-keys: |
${{ runner.os }}-bun-

# Case 1: Run bun for everything EXCEPT Windows ARM
- name: install frontend dependencies
run: bun i

# ------------- Rust & Cargo Cache -------------
- name: install Rust stable (desktop)
if: matrix.mobile == ''
uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-apple-darwin,x86_64-apple-darwin

- name: install Rust stable (android)
if: matrix.mobile == 'android'
uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-linux-android,armv7-linux-androideabi,i686-linux-android,x86_64-linux-android

# MODIFIED: Fixed workspaces syntax and ensured shared key matches matrix
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
# Point this to the folder containing Cargo.toml.
# The action automatically handles the 'target' directory.
workspaces: apps/app/src-tauri
# Adding a key based on the job matrix helps prevent cache conflicts between platforms
key: ${{ matrix.platform }}-${{ matrix.args }}

# ------------- Android -------------
- name: Set up JDK
if: matrix.mobile == 'android'
uses: actions/setup-java@v5
with:
java-version: '17'
distribution: 'temurin'

# NEW: Cache Gradle for Android
- name: Cache Gradle
if: matrix.mobile == 'android'
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-

- name: Setup Android SDK
if: matrix.mobile == 'android'
uses: android-actions/setup-android@v3
- name: Setup Android NDK
if: matrix.mobile == 'android'
uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: r29
link-to-sdk: true
- name: setup Android signing
if: matrix.mobile == 'android'
run: |
cd apps/app/src-tauri/gen/android
echo "keyAlias=${{ secrets.ANDROID_KEY_ALIAS }}" > keystore.properties
echo "password=${{ secrets.ANDROID_KEY_PASSWORD }}" >> keystore.properties
base64 -d <<< "${{ secrets.ANDROID_KEY_BASE64 }}" > $RUNNER_TEMP/keystore.jks
echo "storeFile=$RUNNER_TEMP/keystore.jks" >> keystore.properties

# ------------ Desktop OS ----------------
- name: install dependencies (ubuntu only)
if: startsWith(matrix.platform, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev xdg-utils

# ---------------- Tauri -----------------
- name: Build Tauri Project
uses: tauri-apps/tauri-action@8236c82510173ef930d644f38790c4cf3fd43cf2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
with:
projectPath: 'apps/app'
tagName: v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version.
releaseName: 'Cherit v__VERSION__'
releaseAssetNamePattern: '[name]-[platform]-[arch][ext]'
releaseBody: 'Download from Website : [Download](https://keshav.is-a.dev/Cherit/download/)'
releaseDraft: true
prerelease: false
args: ${{ matrix.args }}
mobile: ${{ matrix.mobile }}
uses: ./.github/workflows/app-build.yml
with:
build-mode: 'release'
publish: true
environment: 'production'
platform: ${{ matrix.platform }}
args: ${{ matrix.args }}
mobile: ${{ matrix.mobile || '' }}
secrets: inherit
Loading
Loading