Skip to content

Commit

Permalink
Added fastlane simple build without signing
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilkedzierski committed Jul 23, 2024
1 parent 5238757 commit 505c253
Show file tree
Hide file tree
Showing 10 changed files with 453 additions and 11 deletions.
147 changes: 147 additions & 0 deletions .github/workflows/build-release-without-signing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
name: Build release without signing - Android and iOS # I don't have dev accounts for both platforms 😅

on:
pull_request:
branches: ['main']

jobs:
build-android:
runs-on: ubuntu-latest
environment: production

steps:
- name: checkout
uses: actions/checkout@v4

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: 'Create .env file'
run: |
touch .env
echo OPEN_WEATHER_API_KEY=${{ secrets.OPEN_WEATHER_API_KEY }} >> .env
echo OPEN_WEATHER_BASE_URL=${{ secrets.OPEN_WEATHER_BASE_URL }} >> .env
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 22
cache: 'yarn'
- name: Gradle cache
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}-${{ hashFiles('**/buildSrc/**/*.kt') }}

- name: Cache Yarn dependencies
uses: actions/cache@v3
with:
path: |
**/node_modules
!**/node_modules/.cache
**/yarn.lock
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3.4
bundler: 2.5.11

- name: Cache Ruby dependencies
uses: actions/cache@v3
with:
path: |
vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Install dependencies
run: |
gem install bundler
bundle install
- name: Run Fastlane
run: yarn fastlane:build:android

- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
name: android-release-app
path: app/build/outputs/apk/release/app-release.apk

build-ios:
runs-on: macos-latest
environment: production

steps:
- name: checkout
uses: actions/checkout@v4

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- uses: actions/cache@v2
with:
path: ios/Pods
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-
- name: 'Create .env file for iOS'
run: |
touch .env
echo OPEN_WEATHER_API_KEY=${{ secrets.OPEN_WEATHER_API_KEY }} >> .env
echo OPEN_WEATHER_BASE_URL=${{ secrets.OPEN_WEATHER_BASE_URL }} >> .env
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3.4
bundler: 2.5.11

- name: Cache Ruby dependencies
uses: actions/cache@v3
with:
path: |
vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Install dependencies
run: |
gem install bundler
bundle install
- name: Install Dependencies
run: yarn bootstrap

- name: Run Fastlane for iOS
run: yarn fastlane:build:ios
4 changes: 3 additions & 1 deletion .github/workflows/e2e-test-production-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ on:
jobs:
test-android:
name: e2e-android-test
runs-on: macos-13
runs-on: ubuntu-latest
environment: production
steps:
- name: checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -72,6 +73,7 @@ jobs:
test-ios:
name: e2e-ios-test
runs-on: macos-13
environment: production
steps:
- name: checkout
uses: actions/checkout@v4
Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ ruby ">= 2.6.10"
# bound in the template on Cocoapods with next React Native release.
gem 'cocoapods', '>= 1.13', '< 1.15'
gem 'activesupport', '>= 6.1.7.5', '< 7.1.0'
gem 'fastlane', '~> 2.221.1'
Loading

0 comments on commit 505c253

Please sign in to comment.