137 lines
No EOL
4.2 KiB
YAML
137 lines
No EOL
4.2 KiB
YAML
name: Validate Pull Request
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
- release_main
|
|
|
|
jobs:
|
|
run-tests:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v3
|
|
- name: Setup Node
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version-file: '.nvmrc'
|
|
cache: 'npm'
|
|
- name: node_modules cache
|
|
uses: actions/cache@v3
|
|
id: npm-cache
|
|
with:
|
|
path: node_modules
|
|
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
|
|
restore-keys: ${{ runner.os }}-npm-
|
|
- name: Install Dependencies
|
|
run: npm ci
|
|
|
|
- name: Run Tests
|
|
run: npm run test
|
|
|
|
build-android:
|
|
if: ${{ startsWith(github.base_ref, 'release_') }}
|
|
needs: run-tests
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v3
|
|
- name: Setup Node
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version-file: '.nvmrc'
|
|
cache: 'npm'
|
|
- name: node_modules cache
|
|
uses: actions/cache@v3
|
|
id: npm-cache
|
|
with:
|
|
path: node_modules
|
|
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
|
|
restore-keys: ${{ runner.os }}-npm-
|
|
- name: Install Dependencies
|
|
run: npm ci
|
|
|
|
- name: Set up Ruby & Fastlane
|
|
uses: ruby/setup-ruby@v1
|
|
with:
|
|
ruby-version: '3.2.1'
|
|
bundler-cache: true
|
|
working-directory: ./android
|
|
- name: Setup Java
|
|
uses: actions/setup-java@v3
|
|
with:
|
|
distribution: 'adopt'
|
|
java-version: '11'
|
|
# caching currently disabled, because the files are large, but don't decrease built time too much
|
|
#cache: gradle
|
|
|
|
- name: Build APK
|
|
working-directory: ./android
|
|
run: bundle exec fastlane buildReleaseApk
|
|
|
|
build-ios:
|
|
if: ${{ startsWith(github.base_ref, 'release_') }}
|
|
needs: run-tests
|
|
runs-on: macos-latest
|
|
permissions:
|
|
contents: read
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v3
|
|
- name: Setup Node
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version-file: '.nvmrc'
|
|
cache: 'npm'
|
|
- name: node_modules cache
|
|
uses: actions/cache@v3
|
|
id: npm-cache
|
|
with:
|
|
path: node_modules
|
|
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
|
|
restore-keys: ${{ runner.os }}-npm-
|
|
- name: Install Dependencies
|
|
run: npm ci
|
|
|
|
- name: Set up Ruby & Fastlane
|
|
uses: ruby/setup-ruby@v1
|
|
with:
|
|
ruby-version: '3.2.1'
|
|
bundler-cache: true
|
|
working-directory: ./ios
|
|
- name: pod install cache
|
|
uses: actions/cache@v3
|
|
id: pod-cache
|
|
with:
|
|
path: ios/Pods
|
|
key: ${{ runner.os }}-pod-${{ hashFiles('ios/Podfile.lock') }}
|
|
restore-keys: ${{ runner.os }}-pod-
|
|
- name: Install iOS Dependencies
|
|
working-directory: ./ios
|
|
run: pod install
|
|
|
|
- name: Restore Internal Provisioning Profile
|
|
env:
|
|
provision_profile_base64: ${{ secrets.CI_EVAL_IOS_PROVISIONING_PROFILE_INTERNAL_BASE64 }}
|
|
run: |
|
|
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
|
|
echo "$provision_profile_base64" | base64 --decode > ~/Library/MobileDevice/Provisioning\ Profiles/internal_profile.mobileprovision
|
|
echo "CI_EVAL_IOS_PROVISIONING_PROFILE_INTERNAL_FILENAME=internal_profile.mobileprovision" >> $GITHUB_ENV
|
|
- name: Restore iOS Cert
|
|
env:
|
|
ios_cert_base64: ${{ secrets.CI_EVAL_IOS_CERT_BASE64 }}
|
|
run: |
|
|
echo "$ios_cert_base64" | base64 --decode > ios_distribution.p12
|
|
echo "CI_EVAL_IOS_CERT_FILE=`pwd`/ios_distribution.p12" >> $GITHUB_ENV
|
|
|
|
- name: Build Release IPA
|
|
env:
|
|
CI_EVAL_IOS_CERT_PASSWORD: ${{ secrets.CI_EVAL_IOS_CERT_PASSWORD }}
|
|
CI_EVAL_INTERNAL_APP_IDENTIFIER: ${{ secrets.CI_EVAL_INTERNAL_APP_IDENTIFIER }}
|
|
working-directory: ./ios
|
|
run: bundle exec fastlane buildReleaseIPA |