Skip to content

Commit

Permalink
chore: add github build for unsigned ipa (tvOS) and apk phone variant (
Browse files Browse the repository at this point in the history
  • Loading branch information
Duell10111 authored Oct 19, 2024
1 parent f096a04 commit 5798f84
Show file tree
Hide file tree
Showing 4 changed files with 157 additions and 1 deletion.
27 changes: 27 additions & 0 deletions .github/actions/prebuild/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Set TV as parameter
description: Configure isTV in app.json

inputs:
is-tv:
description: 'Boolean if isTV prebuild is wanted'
required: true
default: 'false'
platform:
description: 'Platform to prebuild - android or ios'
required: true

runs:
using: composite
steps:
- name: Setup
uses: ./.github/actions/setup
- name: Configure isTV in app.json
run: jq --argjson variable $EXPO_TV '.expo.plugins[0][1].isTV |= $variable | .expo.plugins[2][1].isTV |= $variable' app.json | sponge app.json
shell: bash
env:
EXPO_TV: ${{ inputs.is-tv }}
- name: Prebuild native files
run: npx expo prebuild -p $EXPO_PLATFORM --clean
shell: bash
env:
EXPO_PLATFORM: ${{ inputs.platform }}
106 changes: 106 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: Build
on:
# push:
# branches:
# - main
workflow_dispatch: # Ermöglicht manuelle Auslöser
release:
types: [ published ]

jobs:
build_ios_without_signing_tvos:
name: Build Expo (tvOS) Without Signing
runs-on: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master
- name: Install sponge
run: brew install sponge
- name: Setup
uses: ./.github/actions/prebuild
with:
is-tv: 'true'
platform: "ios"
- name: Build Expo IPA
run: |
cd ios
xcodebuild -scheme reacttube -workspace reacttube.xcworkspace -configuration release archive -archivePath reacttube.xcarchive CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO
../scripts/xcarchive_to_ipa.sh reacttube.xcarchive
- name: Upload IPA
uses: actions/upload-artifact@v4
with:
name: tvos_ipa
path: ios/*.ipa
- name: Upload IPA to Release
if: ${{ github.event_name == 'release' }}
uses: softprops/action-gh-release@v1
with:
files: ios/*.ipa
# build_ios_without_signing_phone: # Disabled as the compile phase throws an error
# name: Build Expo (iOS) Without Signing
# runs-on: macos-latest
# steps:
# - name: Checkout repository
# uses: actions/checkout@v4
# - name: Set up Homebrew
# id: set-up-homebrew
# uses: Homebrew/actions/setup-homebrew@master
# - name: Install sponge
# run: brew install sponge
# - name: Setup
# uses: ./.github/actions/prebuild
# with:
# is-tv: 'false'
# platform: "ios"
# - name: Prebuild iOS
# run: npx expo prebuild -p ios --clean
# - name: Build Expo IPA
# run: |
# cd ios
# xcodebuild -scheme reacttube -workspace reacttube.xcworkspace -configuration release archive -archivePath reacttube.xcarchive CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO
# ../scripts/xcarchive_to_ipa.sh reacttube.xcarchive
# - name: Upload IPA
# uses: actions/upload-artifact@v4
# with:
# name: ios_ipa
# path: ios/*.ipa
# - name: Upload IPA to Release
# if: ${{ github.event_name == 'release' }}
# uses: softprops/action-gh-release@v1
# with:
# files: ios/*.ipa
build_apk_without_signing_phone:
name: Build Expo Android Phone
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Install moreutils
run: sudo apt-get install moreutils
- name: Setup
uses: ./.github/actions/prebuild
with:
is-tv: 'false'
platform: "android"
- name: Build Expo Android
run: |
cd android
./gradlew assembleRelease
- name: Upload IPA
uses: actions/upload-artifact@v4
with:
name: android_phone_apk
path: android/app/build/outputs/apk/release/*.apk
- name: Upload IPA to Release
if: ${{ github.event_name == 'release' }}
uses: softprops/action-gh-release@v1
with:
files: android/app/build/outputs/apk/release/*.apk
1 change: 0 additions & 1 deletion app.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
[
"@react-native-tvos/config-tv",
{
"isTV": true,
"showVerboseWarnings": false,
"tvosDeploymentTarget": "13.4",
"removeFlipperOnAndroid": false,
Expand Down
24 changes: 24 additions & 0 deletions scripts/xcarchive_to_ipa.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash

if [ $# -eq 0 ]; then
echo "Error: No argument provided. Please provide at least one argument."
exit 1
fi

first_arg=$1
source_dir="${first_arg%/}/Products/Applications"

if [ ! -d "$source_dir" ]; then
echo "Error: Source directory does not exist."
exit 1
fi


new_folder="Payload"
rm -rf $new_folder
mkdir $new_folder

cp -a $source_dir/* $new_folder

filename=$(find $new_folder -type d -name '*.app' -exec basename {} \; | head -n 1)
zip -rmq "${filename%.*}.ipa" $new_folder

0 comments on commit 5798f84

Please sign in to comment.