Skip to content

Commit

Permalink
wip: Attempt mobile builds
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmyersdev committed Feb 10, 2025
1 parent 0ee79c2 commit b6dd3a6
Show file tree
Hide file tree
Showing 2 changed files with 97 additions and 29 deletions.
124 changes: 96 additions & 28 deletions .github/workflows/deploy-tauri.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,36 @@ jobs:
fail-fast: false
matrix:
include:
- platform: macos-latest # for Arm based macs (M1 and above).
args: --target aarch64-apple-darwin
- platform: macos-latest # for Intel based macs.
args: --target x86_64-apple-darwin
- platform: ubuntu-22.04 # for Tauri v1 you could replace this with ubuntu-20.04.
args: ''
- platform: windows-latest
args: ''
- name: desktop_macos_arm
platform: macos-latest # for Arm based macs (M1 and above).
args: --verbose --target aarch64-apple-darwin
rust_targets: aarch64-apple-darwin,x86_64-apple-darwin

- name: desktop_macos_intel
platform: macos-latest # for Intel based macs.
args: --verbose --target x86_64-apple-darwin
rust_targets: aarch64-apple-darwin,x86_64-apple-darwin

- name: mobile_ios
platform: macos-latest # for Intel based macs.
args: --verbose --target x86_64-apple-darwin
rust_targets: aarch64-apple-ios,x86_64-apple-ios,aarch64-apple-ios-sim
ios: true

- name: desktop_linux
platform: ubuntu-22.04 # for Tauri v1 you could replace this with ubuntu-20.04.
args: --verbose

- name: mobile_android
platform: ubuntu-latest # for Tauri v1 you could replace this with ubuntu-20.04.
args: --verbose
rust_targets: aarch64-linux-android,armv7-linux-androideabi,i686-linux-android,x86_64-linux-android
android: true

# Not working yet.
# - name: Desktop Windows
# platform: windows-latest
# args: --verbose

runs-on: ${{ matrix.platform }}
steps:
Expand All @@ -68,15 +90,51 @@ jobs:
- name: install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
# 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' || '' }}
targets: ${{ matrix.rust_targets }}

- name: install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-22.04' # This must match the platform value defined above.
if: matrix.platform == 'ubuntu-22.04' || matrix.platform == 'ubuntu-latest' # 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
- name: Install xcode
uses: maxim-lobanov/setup-xcode@v1
if: matrix.ios
with:
xcode-version: latest-stable

- name: Install Java
if: matrix.android
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'

- name: Setup Android SDK
if: matrix.android
uses: android-actions/setup-android@v3

- name: Setup Android NDK
if: matrix.android
uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: r26d
link-to-sdk: true

- name: init android
if: matrix.android
env:
NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
run: |
pnpm tauri android init
- name: init ios
if: matrix.ios
run: |
pnpm tauri ios init
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
Expand Down Expand Up @@ -121,20 +179,30 @@ jobs:
- name: Tauri info
run: |
pnpm tauri info
- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
APPLE_SIGNING_IDENTITY: ${{ env.CERT_ID }}
with:
tagName: app-v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version.
releaseName: App v__VERSION__
releaseBody: See the assets to download this version and install.
releaseDraft: true
prerelease: false
args: ${{ matrix.args }}
- name: Build iOS app
if: matrix.ios
run: |
pnpm tauri ios build --verbose
- name: Build Android app
if: matrix.android
run: |
pnpm tauri android build --verbose
# - uses: tauri-apps/tauri-action@v0
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
# APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
# APPLE_ID: ${{ secrets.APPLE_ID }}
# APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
# APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
# APPLE_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
# APPLE_SIGNING_IDENTITY: ${{ env.CERT_ID }}
# with:
# tagName: app-v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version.
# releaseName: App v__VERSION__
# releaseBody: See the assets to download this version and install.
# releaseDraft: true
# prerelease: false
# args: ${{ matrix.args }}
2 changes: 1 addition & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
"productName": "octo",
"version": "0.1.1",
"version": "0.1.2",
"identifier": "app.octo",
"build": {
"frontendDist": "../dist",
Expand Down

0 comments on commit b6dd3a6

Please sign in to comment.