Skip to content
Merged
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
108 changes: 108 additions & 0 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
name: android

on:
push:
branches: [main]
tags: ["v*"]
pull_request:
workflow_dispatch:
inputs:
build_type:
description: "Build type (debug or release)"
required: false
default: debug
type: choice
options: [debug, release]

permissions:
contents: write

env:
BUILD_TYPE: ${{ github.event.inputs.build_type || 'debug' }}

jobs:
apk:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
with:
version: 10.18.1

- uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm

- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21

- uses: android-actions/setup-android@v3
with:
packages: |
platform-tools
platforms;android-34
build-tools;34.0.0

- name: Install JS deps
run: pnpm install --frozen-lockfile

- name: Build web bundle
run: pnpm --filter tempest-web build

- name: Add Android platform
# `cap add android` scaffolds apps/mobile/android with the gradle
# project. We don't commit it; CI re-creates it every run so the
# build is always reproducible from the current Capacitor config.
working-directory: apps/mobile
run: |
pnpm exec cap add android
pnpm exec cap sync android

- name: Generate launcher icons + splash
working-directory: apps/mobile
run: pnpm exec capacitor-assets generate --android || true

- name: Decode signing keystore
if: env.BUILD_TYPE == 'release' && env.ANDROID_KEYSTORE_BASE64 != ''
env:
ANDROID_KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
run: |
mkdir -p apps/mobile/android/app
echo "$ANDROID_KEYSTORE_BASE64" | base64 -d > apps/mobile/android/app/release.keystore

- name: Assemble APK
working-directory: apps/mobile/android
env:
ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }}
ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}
ANDROID_STORE_PASSWORD: ${{ secrets.ANDROID_STORE_PASSWORD }}
run: |
chmod +x ./gradlew
if [ "$BUILD_TYPE" = "release" ]; then
./gradlew assembleRelease --no-daemon
else
./gradlew assembleDebug --no-daemon
fi

- name: Collect APK
run: |
mkdir -p out
find apps/mobile/android/app/build/outputs/apk -name "*.apk" -exec cp -v {} out/ \;
ls -la out

- uses: actions/upload-artifact@v4
with:
name: tempest-android-${{ env.BUILD_TYPE }}
path: out/*.apk
if-no-files-found: error
retention-days: 14

- name: Attach to release
if: startsWith(github.ref, 'refs/tags/v')
uses: softprops/action-gh-release@v2
with:
files: out/*.apk
111 changes: 111 additions & 0 deletions .github/workflows/desktop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
name: desktop

on:
push:
branches: [main]
tags: ["v*"]
pull_request:
workflow_dispatch:

permissions:
contents: write

jobs:
build:
name: tauri ${{ matrix.platform }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: macos-14
platform: macos-arm64
target: aarch64-apple-darwin
tauri-args: "--target aarch64-apple-darwin"
- os: macos-13
platform: macos-x86_64
target: x86_64-apple-darwin
tauri-args: "--target x86_64-apple-darwin"
- os: ubuntu-22.04
platform: linux-x86_64
target: ""
tauri-args: ""
- os: windows-latest
platform: windows-x86_64
target: ""
tauri-args: ""

steps:
- uses: actions/checkout@v4

- name: Install Linux WebKitGTK + build deps
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y \
libwebkit2gtk-4.1-dev \
libgtk-3-dev \
libayatana-appindicator3-dev \
librsvg2-dev \
libssl-dev \
patchelf

- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}

- uses: Swatinem/rust-cache@v2
with:
workspaces: apps/desktop/src-tauri -> target

- uses: pnpm/action-setup@v4
with:
version: 10.18.1

- uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm

- name: Install JS deps
run: pnpm install --frozen-lockfile

- name: Build web bundle
run: pnpm --filter tempest-web build

- name: Generate platform icons
working-directory: apps/desktop/src-tauri
run: pnpm dlx @tauri-apps/cli icon icons/icon-source.png

- name: Build Tauri bundle
working-directory: apps/desktop
# `--ci` makes the CLI fail fast on any prompt and skip codesigning
# if no signing material is configured.
run: pnpm exec tauri build --ci ${{ matrix.tauri-args }}

- name: Collect bundles
shell: bash
run: |
set -euo pipefail
out=desktop-${{ matrix.platform }}
mkdir -p "$out"
base=apps/desktop/src-tauri/target
if [ -n "${{ matrix.target }}" ]; then base="$base/${{ matrix.target }}"; fi
base="$base/release/bundle"
if [ -d "$base" ]; then
find "$base" -type f \( -name "*.dmg" -o -name "*.app.tar.gz" -o -name "*.deb" -o -name "*.AppImage" -o -name "*.rpm" -o -name "*.msi" -o -name "*.exe" -o -name "*.nsis*" \) -exec cp -v {} "$out/" \; || true
fi
ls -la "$out" || true

- uses: actions/upload-artifact@v4
with:
name: tempest-desktop-${{ matrix.platform }}
path: desktop-${{ matrix.platform }}/*
if-no-files-found: warn
retention-days: 14

- name: Attach to release
if: startsWith(github.ref, 'refs/tags/v')
uses: softprops/action-gh-release@v2
with:
files: desktop-${{ matrix.platform }}/*
109 changes: 109 additions & 0 deletions .github/workflows/ios.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
name: ios

on:
push:
branches: [main]
tags: ["v*"]
workflow_dispatch:

permissions:
contents: write

jobs:
ipa:
runs-on: macos-14
steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
with:
version: 10.18.1

- uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm

- name: Select Xcode
run: sudo xcode-select -s /Applications/Xcode_15.4.app

- name: Install JS deps
run: pnpm install --frozen-lockfile

- name: Install CocoaPods
run: |
gem install cocoapods --no-document
pod --version

- name: Build web bundle
run: pnpm --filter tempest-web build

- name: Add iOS platform
working-directory: apps/mobile
run: |
pnpm exec cap add ios
pnpm exec cap sync ios

- name: Force universal iPhone + iPad build
working-directory: apps/mobile/ios/App
run: |
# TARGETED_DEVICE_FAMILY = "1,2" -> iPhone (1) AND iPad (2).
# Capacitor's default template has been universal since v3, but
# we patch defensively so a tooling regression never silently
# ships an iPhone-only app to iPadOS users.
sed -i.bak 's/TARGETED_DEVICE_FAMILY = "1";/TARGETED_DEVICE_FAMILY = "1,2";/g' App.xcodeproj/project.pbxproj || true
# Allow every iPad orientation; the existing layout already
# handles wide / split-screen widths via the >=900px breakpoint.
/usr/libexec/PlistBuddy -c "Delete :UISupportedInterfaceOrientations~ipad" App/Info.plist 2>/dev/null || true
/usr/libexec/PlistBuddy -c "Add :UISupportedInterfaceOrientations~ipad array" App/Info.plist
for o in UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight; do
/usr/libexec/PlistBuddy -c "Add :UISupportedInterfaceOrientations~ipad: string $o" App/Info.plist
done
# Multitasking: iPad split-view + slide-over without forcing
# full screen.
/usr/libexec/PlistBuddy -c "Set :UIRequiresFullScreen NO" App/Info.plist 2>/dev/null \
|| /usr/libexec/PlistBuddy -c "Add :UIRequiresFullScreen bool NO" App/Info.plist

- name: Generate launcher icons + splash
working-directory: apps/mobile
run: pnpm exec capacitor-assets generate --ios || true

- name: Pod install
working-directory: apps/mobile/ios/App
run: pod install --repo-update

- name: Build archive (unsigned, iPhone + iPad universal)
working-directory: apps/mobile
run: |
xcodebuild \
-workspace ios/App/App.xcworkspace \
-scheme App \
-configuration Release \
-destination 'generic/platform=iOS' \
-archivePath ios/build/App.xcarchive \
TARGETED_DEVICE_FAMILY="1,2" \
CODE_SIGNING_ALLOWED=NO \
CODE_SIGNING_REQUIRED=NO \
CODE_SIGN_IDENTITY="" \
archive

- name: Wrap as Payload.ipa
working-directory: apps/mobile/ios/build
run: |
mkdir -p Payload
cp -R App.xcarchive/Products/Applications/App.app Payload/
/usr/bin/zip -qry Tempest-unsigned.ipa Payload
ls -la

- uses: actions/upload-artifact@v4
with:
name: tempest-ios-unsigned
path: apps/mobile/ios/build/Tempest-unsigned.ipa
if-no-files-found: error
retention-days: 14

- name: Attach to release
if: startsWith(github.ref, 'refs/tags/v')
uses: softprops/action-gh-release@v2
with:
files: apps/mobile/ios/build/Tempest-unsigned.ipa
Loading
Loading