Skip to content

Maple 3.0: Native Rust/SwiftUI/Compose/iced app #7

Maple 3.0: Native Rust/SwiftUI/Compose/iced app

Maple 3.0: Native Rust/SwiftUI/Compose/iced app #7

name: Native 3.0 Desktop Beta
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
workflow_dispatch:
permissions:
contents: read
concurrency:
group: native-3-desktop-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build-macos:
if: github.event_name == 'workflow_dispatch' || github.event.pull_request.head.repo.fork == false
runs-on: macos-26-xlarge
env:
MAPLE_API_ENV: dev
MAPLE_CI_BUILD_ROOT: ${{ github.workspace }}/native/target/maple-ci
CARGO_TERM_COLOR: always
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-apple-darwin,x86_64-apple-darwin
- name: Cache Rust artifacts
uses: Swatinem/rust-cache@v2
with:
workspaces: |
native -> target
- name: Install desktop packaging tools
env:
CARGO_CFG_TARGET_OS: macos
run: |
brew install openssl@3
cargo install tauri-cli --version 2.9.2 --locked
- name: Import Apple Developer certificate
env:
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
run: |
echo "$APPLE_CERTIFICATE" | base64 --decode > "$RUNNER_TEMP/maple-desktop-cert.p12"
security create-keychain -p "$KEYCHAIN_PASSWORD" build.keychain
security default-keychain -s build.keychain
security unlock-keychain -p "$KEYCHAIN_PASSWORD" build.keychain
security set-keychain-settings -t 3600 -u build.keychain
security import "$RUNNER_TEMP/maple-desktop-cert.p12" -k build.keychain -P "$APPLE_CERTIFICATE_PASSWORD" -T /usr/bin/codesign
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$KEYCHAIN_PASSWORD" build.keychain
CERT_ID=$(security find-identity -v -p codesigning build.keychain | awk -F '"' '/Developer ID Application/ { print $2; exit }')
echo "APPLE_SIGNING_IDENTITY=$CERT_ID" >> "$GITHUB_ENV"
- name: Set up App Store Connect API key
env:
APPLE_API_PRIVATE_KEY: ${{ secrets.APPLE_API_PRIVATE_KEY }}
APPLE_API_KEY: ${{ secrets.APPLE_API_KEY }}
run: |
mkdir -p "$RUNNER_TEMP/app-store-connect"
echo "$APPLE_API_PRIVATE_KEY" | base64 --decode > "$RUNNER_TEMP/app-store-connect/AuthKey_${APPLE_API_KEY}.p8"
chmod 600 "$RUNNER_TEMP/app-store-connect/AuthKey_${APPLE_API_KEY}.p8"
echo "APPLE_API_KEY_PATH=$RUNNER_TEMP/app-store-connect/AuthKey_${APPLE_API_KEY}.p8" >> "$GITHUB_ENV"
- name: Build notarized macOS beta artifacts
env:
APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }}
APPLE_API_KEY: ${{ secrets.APPLE_API_KEY }}
APPLE_API_KEY_PATH: ${{ env.APPLE_API_KEY_PATH }}
APPLE_SIGNING_IDENTITY: ${{ env.APPLE_SIGNING_IDENTITY }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
run: bash native/scripts/ci/package-macos.sh
- name: Upload macOS artifacts
uses: actions/upload-artifact@v4
with:
name: native-desktop-macos-beta
path: |
native/target/maple-ci/desktop-macos/*.dmg
native/target/maple-ci/desktop-macos/*.zip
native/target/maple-ci/desktop-macos/*.sig
retention-days: 7
build-linux:
if: github.event_name == 'workflow_dispatch' || github.event.pull_request.head.repo.fork == false
runs-on: ubuntu-latest-8-cores
env:
MAPLE_API_ENV: dev
MAPLE_CI_BUILD_ROOT: ${{ github.workspace }}/native/target/maple-ci
CARGO_TERM_COLOR: always
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache Rust artifacts
uses: Swatinem/rust-cache@v2
with:
workspaces: |
native -> target
- name: Install Linux desktop build tools
env:
CARGO_CFG_TARGET_OS: linux
run: |
sudo apt-get update
sudo apt-get install -y \
desktop-file-utils \
dpkg-dev \
file \
libasound2-dev \
libdbus-1-dev \
libfontconfig1-dev \
libfreetype6-dev \
libgl1-mesa-dev \
libssl-dev \
libudev-dev \
libwayland-dev \
libx11-dev \
libx11-xcb-dev \
libxcb-render0-dev \
libxcb-shape0-dev \
libxcb-xfixes0-dev \
libxcb1-dev \
libxkbcommon-dev \
libxcursor-dev \
libxi-dev \
libxinerama-dev \
libxrandr-dev \
openssl \
patchelf \
pkg-config \
squashfs-tools
cargo install tauri-cli --version 2.9.2 --locked
- name: Build Linux beta artifacts
env:
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
run: bash native/scripts/ci/package-linux.sh
- name: Upload Linux artifacts
uses: actions/upload-artifact@v4
with:
name: native-desktop-linux-beta
path: |
native/target/maple-ci/desktop-linux/*.AppImage
native/target/maple-ci/desktop-linux/*.deb
native/target/maple-ci/desktop-linux/*.sig
retention-days: 7