Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Github Actions build with Fastlane #586

Merged
merged 63 commits into from
Nov 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
a84e337
feat: Simple fastlane ios build
cbrevik Aug 12, 2020
734f5fe
cache node_modules
cbrevik Aug 14, 2020
35636a1
Update react-native-dotenv
cbrevik Aug 14, 2020
46550a7
fix name
cbrevik Aug 14, 2020
e12e7bf
fix: Decrypt env
cbrevik Aug 17, 2020
8973808
ssshhh
cbrevik Aug 17, 2020
7a567ed
feat: Add match
cbrevik Aug 19, 2020
3f570d9
fix: Add env var for url
cbrevik Aug 19, 2020
d982468
Add ssh key for match repo
cbrevik Aug 19, 2020
34d0746
Add match password
cbrevik Aug 19, 2020
fee97e9
Override env and config files to correct release stage
cbrevik Aug 19, 2020
115469a
Fix install bug, and redirect export output
cbrevik Aug 19, 2020
55dbd93
Update appid via fastlane
cbrevik Aug 19, 2020
8bc35db
Enable manual signing and match profiles
cbrevik Aug 19, 2020
c2e38b8
Create keychain
cbrevik Aug 19, 2020
417a652
appid
cbrevik Aug 19, 2020
963fedd
appid
cbrevik Aug 19, 2020
7f08695
test
cbrevik Aug 19, 2020
4dc54fd
please
cbrevik Aug 19, 2020
2ae957c
Why are you still using debug
cbrevik Aug 19, 2020
de8ab09
Update code sign identity
cbrevik Aug 19, 2020
5e668bb
Update code sign settings
cbrevik Aug 19, 2020
5ff8fca
Add appcenter
cbrevik Aug 20, 2020
61380da
feat: Add AppCenter dist
cbrevik Aug 21, 2020
3eb5d54
fix: Update appcenter plugin to non-broken version
cbrevik Oct 13, 2020
3e5e2f8
feat: Add bundle replacement in ipa
cbrevik Oct 14, 2020
95d0f43
fix?
cbrevik Oct 14, 2020
2f9a466
colons eh
cbrevik Oct 14, 2020
6008f15
colon-space eh
cbrevik Oct 14, 2020
72af706
TEST: change some code, revert later
cbrevik Oct 14, 2020
e6b44d2
fix: Split cert match and build
cbrevik Oct 14, 2020
cef47cd
rename lane
cbrevik Oct 14, 2020
94e35b9
Include source maps for bugsnag upload (incomplete)
cbrevik Oct 15, 2020
7bfa542
fix: Android build
cbrevik Oct 15, 2020
64304a1
fix quotes
cbrevik Oct 15, 2020
27b57bd
fix api key env
cbrevik Oct 15, 2020
90d46af
Add icon generation
cbrevik Oct 15, 2020
8632507
Echo on replace script
cbrevik Oct 15, 2020
3f19fba
fix: Move to use env variables for secrets
cbrevik Oct 16, 2020
c90ea64
fix secret name
cbrevik Oct 16, 2020
71dd1fe
fix secret name
cbrevik Oct 16, 2020
10f06a9
arg
cbrevik Oct 16, 2020
2545298
don't quote maybe
cbrevik Oct 16, 2020
87d4707
there you are
cbrevik Oct 16, 2020
a545b79
use zip instead of decompiled sources
cbrevik Oct 17, 2020
70c5c0a
feat: Update versionCode/bundleVersion based on new BUILD_ID
cbrevik Oct 19, 2020
5976b7a
fix: Local run
cbrevik Oct 20, 2020
6cfe7dd
fix: Actually use version code in gradle file
cbrevik Oct 20, 2020
ae51083
fix: Better file structure
cbrevik Oct 20, 2020
63daa1e
fix: Keystore in script
cbrevik Oct 20, 2020
53df926
feat: Source maps upload to bugsnag
cbrevik Oct 20, 2020
0cbc331
"ok"
cbrevik Oct 20, 2020
edea9f0
fix icon generation
cbrevik Oct 20, 2020
fa2e431
fix again
cbrevik Oct 20, 2020
c1c6329
dont put key in env since it won't be censored
cbrevik Oct 20, 2020
b8a278e
fix: Only run on master branch
cbrevik Oct 20, 2020
cdb675e
fix test change
cbrevik Oct 20, 2020
c6b03c3
fix so appcenter still works
cbrevik Oct 20, 2020
b59c70d
feat: Add dSYM upload
cbrevik Oct 20, 2020
528380e
oop
cbrevik Oct 20, 2020
f976072
Merge branch 'master' into cbrevik/fastlane-github-actions
cbrevik Oct 21, 2020
c38127d
Still have to decrypt on AppCenter
cbrevik Oct 21, 2020
c8c23d6
Merge branch 'master' into cbrevik/fastlane-github-actions
cbrevik Nov 3, 2020
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
78 changes: 78 additions & 0 deletions .github/workflows/build-staging-android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Build staging Android project
on:
push:
branches:
- master

jobs:
build-ios:
name: Build Android
runs-on: macOS-latest
steps:
- name: Checkout project
uses: actions/checkout@v1
- name: Set global env vars
run: |
echo "BUILD_ID=$(date +%s)" >> $GITHUB_ENV
echo "APP_ENVIRONMENT=staging" >> $GITHUB_ENV
- name: Decrypt env files
run: sh ./scripts/git-crypt-unlock.sh
env:
GIT_CRYPT_KEY: ${{ secrets.GIT_CRYPT_KEY }}
- name: install node v12
uses: actions/setup-node@v1
with:
node-version: 12
- name: Get potential cached node_modules
uses: actions/cache@v2
id: modules-cache
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**/patches/**.patch') }}
- name: Install node_modules
if: steps.modules-cache.outputs.cache-hit != 'true'
run: yarn install
- name: Bundle install, fastlane dependencies
run: bundle install
- name: Set environment
run: sh ./scripts/override-environment.sh $APP_ENVIRONMENT
- name: Override native config files
run: sh ./scripts/override-config-files.sh
- name: Get potential cached APK
uses: actions/cache@v2
id: apk-cache
with:
path: 'app-staging.apk'
key: ${{ runner.os }}-android-cache-${{ hashFiles('android/**') }}
- name: Get Android keystore
run: sh ./scripts/android/create-keystore-file.sh
env:
GPG_KEYSTORE_FILE: ${{ secrets.GPG_KEYSTORE_FILE }}
GPG_KEYSTORE_PASS: ${{ secrets.GPG_KEYSTORE_PASS }}
- name: Generate icons
if: steps.apk-cache.outputs.cache-hit != 'true'
run: brew install imagemagick && yarn app-icon generate -i icon.qa.png --platforms=android --rounded none && yarn app-icon generate -i icon.qa.round.png --platforms=android --rounded only
- name: Run fastlane build
if: steps.apk-cache.outputs.cache-hit != 'true'
run: yarn build:android
env:
KEYSTORE_PASS: ${{ secrets.ATB_KEYSTORE_PASS }}
KEY_PASS: ${{ secrets.ATB_KEY_PASS }}
KEY_ALIAS: ${{ secrets.ATB_KEY_ALIAS }}
- name: Replace apk bundle
if: steps.apk-cache.outputs.cache-hit == 'true'
run: sh ./scripts/android/replace-bundle.sh
env:
APK_FILE_NAME: app-staging.apk
KEYSTORE_FILE: keystore.jks
KEYSTORE_PASS: ${{ secrets.ATB_KEYSTORE_PASS }}
KEY_PASS: ${{ secrets.ATB_KEY_PASS }}
KEY_ALIAS: ${{ secrets.ATB_KEY_ALIAS }}
- name: Distribute to AppCenter
run: yarn appcenter:android
env:
APPCENTER_API_KEY: ${{ secrets.APPCENTER_ANDROID_API_KEY }}
- name: Upload bundle and source maps
run: sh ./scripts/android/upload-sourcemaps.sh
env:
BUGSNAG_API_KEY: ${{ secrets.BUGSNAG_API_KEY }}
83 changes: 83 additions & 0 deletions .github/workflows/build-staging-ios.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Build staging iOS project
on:
push:
branches:
- master

jobs:
build-ios:
name: Build iOS
runs-on: macOS-latest
steps:
- name: Checkout project
uses: actions/checkout@v1
- name: Set global env vars
run: |
echo "BUILD_ID=$(date +%s)" >> $GITHUB_ENV
echo "APP_ENVIRONMENT=staging" >> $GITHUB_ENV
- name: Decrypt env files
run: sh ./scripts/git-crypt-unlock.sh
env:
GIT_CRYPT_KEY: ${{ secrets.GIT_CRYPT_KEY }}
- name: install node v12
uses: actions/setup-node@v1
with:
node-version: 12
- name: Get potential cached node_modules
uses: actions/cache@v2
id: modules-cache
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**/patches/**.patch') }}
- name: Install node_modules
if: steps.modules-cache.outputs.cache-hit != 'true'
run: yarn install
- name: Bundle Install
run: bundle install
- name: Set environment
run: sh ./scripts/override-environment.sh $APP_ENVIRONMENT
- name: Override native config files
run: sh ./scripts/override-config-files.sh
- uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.MATCH_SSH_PRIVATE_KEY }}
- name: Get potential cached ipa
uses: actions/cache@v2
id: ipa-cache
with:
path: 'AtB.ipa'
key: ${{ runner.os }}-ios-cache-${{ hashFiles('ios/**') }}
- name: Run fastlane cert match
run: yarn cert:ios
env:
FASTLANE_MATCH_URL: ${{ secrets.FASTLANE_MATCH_URL }}
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
- name: Generate icons
if: steps.ipa-cache.outputs.cache-hit != 'true'
run: brew install imagemagick && yarn app-icon generate -i icon.qa.png --platforms=ios
- name: Run fastlane build
if: steps.ipa-cache.outputs.cache-hit != 'true'
run: yarn build:ios
- name: Replace ipa bundle
if: steps.ipa-cache.outputs.cache-hit == 'true'
run: sh ./scripts/ios/replace-bundle.sh
env:
IPA_FILE_NAME: 'AtB.ipa'
APP_NAME: 'AtB.app'
CODE_SIGN_IDENTITY: ${{ secrets.IOS_CODE_SIGN_IDENTITY }}
- name: Distribute to AppCenter
run: yarn appcenter:ios
env:
APPCENTER_API_KEY: ${{ secrets.APPCENTER_IOS_API_KEY }}
- name: Create bundle and source maps
if: steps.ipa-cache.outputs.cache-hit != 'true'
run: sh ./scripts/ios/create-sourcemaps.sh
- name: Upload bundle and source maps
run: sh ./scripts/ios/upload-sourcemaps.sh
env:
BUGSNAG_API_KEY: ${{ secrets.BUGSNAG_API_KEY }}
- name: Upload dSYMs
if: steps.ipa-cache.outputs.cache-hit != 'true'
run: sh ./scripts/ios/upload-dsyms.sh
env:
BUGSNAG_API_KEY: ${{ secrets.BUGSNAG_API_KEY }}
7 changes: 7 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
source "https://rubygems.org"

gem "fastlane"
gem "cocoapods"

plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile')
eval_gemfile(plugins_path) if File.exist?(plugins_path)
Loading