Skip to content

Instantly share code, notes, and snippets.

@hansemannn
Created September 14, 2022 20:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hansemannn/14926ef781b5bce4e97cc7630c1e4452 to your computer and use it in GitHub Desktop.
Save hansemannn/14926ef781b5bce4e97cc7630c1e4452 to your computer and use it in GitHub Desktop.
Titanium Github Action (iOS + Android)
name: Build Titanium App
on:
push:
branches:
- '**'
tags-ignore: # Do not run if we push tags
- '**'
jobs:
build:
runs-on: macos-12
steps:
- uses: actions/checkout@v3
with:
lfs: true
- name: Checkout LFS objects (Google Maps SDK)
run: git lfs checkout
- name: Install Java 11
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '11'
- name: Select Xcode 14
run: |
sudo xcode-select -s "/Applications/Xcode_14.0.app"
- name: Install Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: '16.x'
- name: Install npm dependencies
run: |
npm ci
- name: Lint sources
run: |
npm run lint
- name: Cache Gradle packages
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Cache Node.js modules
id: node-cache
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.OS }}-node-modules-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node-modules-
${{ runner.OS }}-
- name: Install Titanium CLI and Alloy
run: |
npm i -g titanium
ti sdk install latest
npm i -g alloy
# TODO: Add certificate handling for iOS production builds
- name: Build iOS app
if: always()
run: |
ti build -p ios --log-level trace --build-only
- name: Build Android app
if: always()
run: |
ti build -p android --log-level trace -T dist-playstore -K android.keystore -P '${{ secrets.KEYSTORE_SECRET }}' --output-dir dist --build-only
- name: Cleanup Gradle Cache
# Remove some files from the Gradle cache, so they aren't cached by GitHub Actions.
# Restoring these files from a GitHub Actions cache might cause problems for future builds.
if: always()
run: |
rm -f ~/.gradle/caches/modules-2/modules-2.lock
rm -f ~/.gradle/caches/modules-2/gc.properties
# /build/android/app/build/outputs/apk/debug
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment