Skip to content

Commit

Permalink
Add github CI for fastlane, disabled for now
Browse files Browse the repository at this point in the history
  • Loading branch information
Codel1417 committed May 20, 2024
1 parent 7c937bd commit 13f4997
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 3 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,17 @@ jobs:
SENTRY_URL: ${{ secrets.SENTRY_URL }}
SENTRY_RELEASE: ${{ steps.build.outputs.SENTRY_RELEASE }}
SENTRY_DIST: ${{ steps.build.outputs.SENTRY_DIST }}
- name: Upload Beta
if: github.event_name == 'push1' || github.event_name == 'release1' # Disabled for now
run: bash ${GITHUB_WORKSPACE}/Scripts/fastlane.sh
working-directory: Scripts
continue-on-error: true
env:
VERSION: ${{ steps.build.outputs.SENTRY_RELEASE }}
BUILD_NUMBER: ${{ steps.build.outputs.SENTRY_DIST }}
GOOGLE_SECRETS: ${{ secrets.GOOGLE_PLAY }}
APPLE_SECRETS: ${{ secrets.APPLE }}

release-job:
name: Releasing
needs: [ build_android ]
Expand Down
22 changes: 22 additions & 0 deletions Scripts/fastlane.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
set -e
set -x

# -v checks if a variable exists


# We want to be in the project root folder, not the scripts folder
if [[ "$(pwd)" == *"/Scripts" ]]; then
cd ..
fi

if [[ $GITHUB_EVENT_NAME == 'pull_request' ]]; then
exit 1
fi

if [[ $OS == 'macos-latest' ]]; then
cd ios
fastlane beta
else
cd android
fastlane beta
fi
6 changes: 4 additions & 2 deletions android/fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ update_fastlane

default_platform(:android)
desc "Deploy a new version to the Google Play"
lane :deploy do
lane :beta do
setup_ci if ENV['CI']
# note the `..`, since fastlane runs in the _fastlane_ directory
changelog = File.read("../../CHANGELOG.md")
#gradle(task: "clean assembleRelease")
upload_to_play_store(aab: "../build/app/outputs/bundle/release/app-release.aab", track:"beta")
upload_to_play_store(aab: "../build/app/outputs/bundle/release/app-release.aab", track:"beta", release_notes: changelog, version_code: ENV['BUILD_NUMBER'], version_name: ENV['VERSION'], , json_key_data: ENV['GOOGLE_SECRETS'])
end
end
5 changes: 4 additions & 1 deletion ios/fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ platform :ios do
desc "Push a new beta build to TestFlight"
lane :beta do
setup_ci if ENV['CI']

# note the `..`, since fastlane runs in the _fastlane_ directory
changelog = File.read("../../CHANGELOG.md")
build_app(workspace: "Runner.xcworkspace", scheme: "Runner")
upload_to_testflight(skip_waiting_for_build_processing: true)
upload_to_testflight(skip_waiting_for_build_processing: true, changelog:changelog, build_number: ENV['BUILD_NUMBER'], app_version: ENV['VERSION'], reject_build_waiting_for_review: true)
end
end

0 comments on commit 13f4997

Please sign in to comment.