Skip to content

Commit

Permalink
Feature/add fastlane (#802)
Browse files Browse the repository at this point in the history
* alright let's see if this works on my branch now

* check in ios assets and correctly reference keystore for android

* alright fine, let's do it the simple way

* OK so I'll decode the json key too

* whoops, still passing old variable

* but type the command right

* patch for redbox error on commons.io, create a staging debug artifact with release JS

* fix update build paths

* correct decode command and limit staging to correct branch builds

* enable an ios staging build and keep working on android

* be more generic in the ios version I'm using for staging

* order matters

* select a simulator that exists

* add git ignore to reomve the yarn.lock ignore

* acually push the patch changes using yarn.lock

* pass the paths directly

* OK let's get the android fastfile going

* get a staging file up there for ipas

* just build the ios staging build for now, to conserve resources

* supply the match type per command

* specify working directory for assets dir

* OK try doing this as all one big command

* cmon lucky number who knows how many

* try again with apple directory and ignore the apk build for android

* OK let's try without passing along the secrets to gradle properties

* add ignore upload for build flag, hope that the signing works right

* alright, let's try this then

* these paths are gonna drive me nuts lol

* one more try

* run development and appstore match for mixed build

* stash some changes

* attempt to just use the references all bare like

* enable flag in beta, use beta for staging build

* let's do android first

* change the names of the artifacts for staging so they're more obvious. push to testflight

* try removing one layer of abstraction for android release

* let's not use air quotes by accident then

* remove the cache check for ruby for now

* this will eventually work I swear

* use properties again 'cause why not

* this is so annoying

* push to testflight and enable downloading the app

* one last try on my own with this android stuff

* add tooling to debug local realm writes on android

* get iOS to build an IPA file in debug mode that we can install on test devices.

* enable android and ios staging builds, make android build not crash

* push up the workflows as they are

* build the staging artifacts too

* don't build the betas twice

* see if changing gradle references works

* but actually build the android package

* use system get env

* let's see if we can get ios to behave

* well that was totally intentional

* make ios ipa builds succeed, and try to fix android properties

* create a new ios beta build, to represent release and adhoc signing

* add in a new scheme and reference it correctly in fastlane

* force ios to upload without waiting for the app store to process, see if we can get android to work again

* get this in a mergeable state

* add fastlane

* Ok comment out the version bump stuff for now

* ci: version bump to v1.0.7

* revert incorrect patch, update build.gradle reference, use new node cache command

* ci: version bump to v1.0.8

* comment out android release for now, note that beta-ios build is temporary

* add names to trigger another build and make the version bump work

* comment out the version bump thing for now

* try a different version bump tool, fix build and dev_setup steps

* attempt to fix android signing by using a different keystore decrypt method

* remove log line

* whoops, let's push up these fixes too

* name the file correctly

* forgot I renamed the fastlane name

* use the lane context to validate the path of the AAB

* start with a version code we've not used yet

* updates to Pods, don't ignore Podfile.lock

* use the correct lane name

* hope this busts the cocoapods cache for iOS

* reference itself instead of master for commit history

* let's see how this goes

* properly name the artifacts; declare  for android release

* let's try the other version bump thing again, without node setup

* meaningful whitespace

* remove the tag prefix and hope it fixes our version bump

* pin to latest release version

* tried adding repo to action

* try a different version bump tool

* alright force it to run now

* allow unrelated histories

* try forcing master version of this tool

* dont allow unrelated changes

* try using another token to see if a PAT might help

* try another package bump action

* let's see what this does

* this is the definition of insanity

* try to use an older version

* reintroduce the old node job

* try using this other tool, but pin a specific version

* try giving it an email

* try using master and removing email

* just use yarn and don't commit it back

* try a different plugin

* meaningful whitespace

* OK try turning off the paths-ignore

* OK try it again

* remove ios build that wasn't building

* try this out

* try pinning v2

* use v2 checkout

* force the branch I'm on

* get the branch name

* assume that this only works on push

* chore(release): 1.0.11

* prepare for review

* remove comment

* remove release build that's not signed

* rename task because gradle

* shorten name

* remove cocoapod cache

Co-authored-by: Automated Version Bump <[email protected]>
Co-authored-by: Conventional Changelog Action <[email protected]>
  • Loading branch information
3 people authored May 13, 2020
1 parent 6351201 commit 4359952
Show file tree
Hide file tree
Showing 34 changed files with 3,008 additions and 1,286 deletions.
12 changes: 12 additions & 0 deletions .env.staging
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This is the Staging .env file, it is built for automated testing enviroments
# Flags that are ready for testing/staging should be enabled here.

# When making any Staging channel build on both iOS or Android, prepend the build
# command with ENVFILE=.env.staging
#
# e.g.
#
# ENVFILE=.env.staging ./gradlew assembleRelease

flag_better_location_status_checks=true
# flag_google_import=true
79 changes: 79 additions & 0 deletions .github/workflows/beta-ios.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
## This is a work in progress

on:
push:
tags:
- 'sec*' # Push events to matching sec* . Use this to tag a security assets build

jobs:
build_staging_ios:
runs-on: macOS-latest
steps:
- uses: actions/checkout@master

- name: Set XCode Version
run: sudo xcode-select -s /Applications/Xcode_11.app

- name: Cache node_modules/
uses: actions/cache@v1
id: node_cache
with:
path: node_modules
key: ${{ runner.OS }}-yarn-cache-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-yarn-cache-
- name: Install Node Dependencies
if: steps.node_cache.outputs.cache-hit != 'true'
run: yarn --frozen-lockfile

- name: Install bundler for ruby package management
run: gem install bundler -v "$(grep -A 1 "BUNDLED WITH" ./Gemfile.lock | tail -n 1)"
working-directory: ./ios

- name: Cache ruby gems
uses: actions/cache@v1
id: ruby_cache
with:
path: ios/vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/ios/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Install Ruby Dependencies
if: steps.ruby_cache.outputs.cache-hit != 'true'
run: |
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
working-directory: ./ios

- name: Install Cocoapods
run: pod install --repo-update
working-directory: ./ios

- name: Setup SSH Keys and known_hosts
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: |
mkdir -p ~/.ssh
ssh-keyscan github.com >> ~/.ssh/known_hosts
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
ssh-add - <<< "${{ secrets.MATCH_SSH_CERT }}"
- name: Build iOS Beta artifact for devices
uses: maierj/[email protected]
env:
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
FASTLANE_PASSWORD: ${{ secrets.FASTLANE_PASSWORD }}
MATCH_GIT_BASIC_AUTH: ${{ secrets.MATCH_GIT_BASIC_AUTH }}
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
with:
lane: 'beta'
subdirectory: 'ios'
bundle-install-path: 'vendor/bundle'

- name: Upload Artifact
uses: actions/upload-artifact@v1
with:
name: Debug IPA file (work in progress)
path: ios/COVIDSafePaths-beta.ipa
89 changes: 2 additions & 87 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,97 +42,12 @@ jobs:
- name: Bundle JS
run: npx react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/ --verbose

- run: ./gradlew assembleDebug --no-daemon
- run: ./gradlew assembleDevDebug --no-daemon
working-directory: ./android

- name: Upload APK
uses: actions/upload-artifact@v1
with:
name: Debug APK
path: android/app/build/outputs/apk/debug/app-debug.apk
path: android/app/build/outputs/apk/dev/debug/app-dev-debug.apk

# attempt a release build, some things work in debug and not in release
build-android-release:
needs: build-android
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Cache node_modules/
uses: actions/cache@v1
with:
path: node_modules
key: ${{ runner.OS }}-yarn-cache-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-yarn-cache-
- run: yarn --frozen-lockfile

- name: Cache gradle
uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- run: ./gradlew bundleRelease --no-daemon
working-directory: ./android


build-ios:
runs-on: macOS-latest
steps:
- uses: actions/checkout@master

- name: Set XCode Version
run: sudo xcode-select -s /Applications/Xcode_11.app

- name: Cache node_modules/
uses: actions/cache@v1
with:
path: node_modules
key: ${{ runner.OS }}-yarn-cache-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-yarn-cache-
- run: yarn --frozen-lockfile

- name: Cache ruby gems
uses: actions/cache@v1
with:
path: ios/vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Install ruby gems (including Cocoapods)
run: |
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
working-directory: ./ios

- name: Cache CocoaPods
uses: actions/cache@v1
with:
path: ios/Pods
key: ${{ runner.OS }}-pods-${{ hashFiles('**/Podfile.lock') }}
restore-keys: |
${{ runner.OS }}-pods-
- run: pod install --repo-update
working-directory: ./ios

- name: Bundle iOS JS
run: npx react-native bundle --dev false --entry-file index.js --bundle-output ios/main.jsbundle --platform ios --verbose
# - name: Build App
# # xcodebuild -workspace COVIDSafePaths.xcworkspace -configuration Debug -scheme COVIDSafePaths
# # xcodebuild -workspace COVIDSafePaths.xcworkspace -scheme COVIDSafePaths archive -archivePath COVIDSafePaths.xcarchive -allowProvisioningUpdates
# # xcodebuild -exportArchive -archivePath ./COVIDSafePaths.xcarchive -exportPath . -exportOptionsPlist COVIDSafePaths/Info.plist
# run: xcodebuild -workspace COVIDSafePaths.xcworkspace -scheme COVIDSafePaths archive -archivePath COVIDSafePaths.xcarchive -allowProvisioningUpdates
# working-directory: ./ios
# - name: Upload Artifact
# uses: actions/upload-artifact@v1
# with:
# name: Debug IPA
# path: ios/build/
12 changes: 0 additions & 12 deletions .github/workflows/dev_setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ jobs:
- name: Bundle JS
run: npx react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/ --verbose

- name: Build APK (gradle)
run: ./gradlew assembleDebug --no-daemon
working-directory: ./android

test-mac:
runs-on: macOS-latest
steps:
Expand All @@ -56,14 +52,6 @@ jobs:
restore-keys: |
${{ runner.os }}-gems-
- name: Cache CocoaPods
uses: actions/cache@v1
with:
path: ios/Pods
key: ${{ runner.OS }}-pods-${{ hashFiles('**/Podfile.lock') }}
restore-keys: |
${{ runner.OS }}-pods-
- run: CI=true ./dev_setup.sh -ni

- run: yarn && yarn run test:dev_setup
Expand Down
Loading

0 comments on commit 4359952

Please sign in to comment.