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

Ci/setup fastlane #1219

Draft
wants to merge 6 commits into
base: develop
Choose a base branch
from
Draft

Ci/setup fastlane #1219

wants to merge 6 commits into from

Conversation

limwa
Copy link
Member

@limwa limwa commented Apr 2, 2024

Closes #506

Sets up fastlane for the CI.

  • Setup fastlane on Android.
  • Setup fastlane on iOS.
  • Setup CI to use fastlane.
  • Add build instructions.

Review checklist

  • Terms and conditions reflect the current change
  • Contains enough appropriate tests
  • If aimed at production, writes a new summary in whatsnew/whatsnew-pt-PT
  • Properly adds an entry in changelog.md with the change
  • If PR includes UI updates/additions, its description has screenshots
  • Behavior is as expected
  • Clean, well-structured code

@limwa
Copy link
Member Author

limwa commented Apr 2, 2024

----------------------
--- fastlane lanes ---
----------------------
fastlane uses a `Fastfile` to store the automation configuration
Within that, you'll see different lanes.
Each is there to automate a different task, like screenshots, code signing, or pushing new releases
Continue by pressing Enter ⏎

--------------------------------------
--- How to customize your Fastfile ---
--------------------------------------
Use a text editor of your choice to open the newly created Fastfile and take a look
You can now edit the available lanes and actions to customize the setup to fit your needs
To get a list of all the available actions, open https://docs.fastlane.tools/actions
Continue by pressing Enter ⏎

------------------------------
--- Where to go from here? ---
------------------------------
📸  Learn more about how to automatically generate localized Google Play screenshots:
            https://docs.fastlane.tools/getting-started/android/screenshots/
👩‍✈️  Learn more about distribution to beta testing services:
            https://docs.fastlane.tools/getting-started/android/beta-deployment/
🚀  Learn more about how to automate the Google Play release process:
            https://docs.fastlane.tools/getting-started/android/release-deployment/

To try your new fastlane setup, just enter and run
$ fastlane test

Copy link

codecov bot commented Apr 2, 2024

Codecov Report

Merging #1219 (2c6d504) into develop (9cbaa3e) will decrease coverage by 0%.
Report is 1 commits behind head on develop.
The diff coverage is n/a.

Additional details and impacted files
@@           Coverage Diff           @@
##           develop   #1219   +/-   ##
=======================================
- Coverage       17%     17%   -0%     
=======================================
  Files          229     229           
  Lines         6986    6986           
=======================================
- Hits          1150    1149    -1     
- Misses        5836    5837    +1     

Copy link
Collaborator

@DGoiana DGoiana left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before approval, I need to run pod install in order to create a new updated Podfile.lock

@bdmendes
Copy link
Member

bdmendes commented Apr 3, 2024

@limwa does fastlane support changing store descriptions, e.g. screenshots? That's awesome.

@limwa
Copy link
Member Author

limwa commented Apr 3, 2024

@limwa does fastlane support changing store descriptions, e.g. screenshots? That's awesome.

Yes, it does! Updating descriptons and screenshots should be done through fastlane once this PR is merged!

Comment on lines +28 to +29
increment_build_number(xcodeproj: "Runner.xcodeproj")
commit_version_bump(xcodeproj: "Runner.xcodeproj")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double-check how this overrides/replaces our current versioning schema

Comment on lines +1 to +2
---
BUNDLE_SET: "path ./vendor/bundle"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this for?

@@ -128,3 +128,6 @@ app.*.symbols

# Flutter Devtools
devtools_options.yaml

# Google Service Account Key
/android/google-service-account-key.json
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bartekpacia
Copy link
Collaborator

bartekpacia commented Jun 26, 2024

I'd consider setting up Fastlane once, instead of twice (for Android and iOS).

In my previous projects (at companies & personal ones), Fastlane was always being set up twice, but I'm wondering if if we do it once, it'll be better.

The main con of the current approach is that when updating Fastlane, everything has to be done twice (for no good reason). And then there's also duplication.

In other words, I suggest:

├── lib/
├── android/
├── ios/
├── fastlane/
│   ├── Gemfile
│   ├── Gemfile.lock
│   └── fastlane/
│       ├── Appfile
│       ├── Fastfile
│       ├── Matchfile
│       ├── Pluginfile

instead of:

├── lib/
├── android/
│   ├── Gemfile
│   ├── Gemfile.lock
│   └── fastlane/
│       ├── Appfile
│       ├── Fastfile
│       ├── Matchfile
├── ios/
│   ├── Gemfile
│   ├── Gemfile.lock
│   └── fastlane/
│       ├── Appfile
│       ├── Fastfile
│       ├── Matchfile

Fastlane is very much configurable, so I'm pretty sure we can make this setup work. Rn I'm in the process of trying it out in a personal project of mine (https://github.com/bartekpacia/opencaching), when I finish I can get back to you with the results.

@limwa
Copy link
Member Author

limwa commented Jun 26, 2024

@bartekpacia the reason it is done this way is because it is the recommended way in the documentation
I'm not sure about using only a single fastlane installation, it would still need to be duplicated in the Fastfile because some steps are not supported in Android, but are in iOS, or vice-versa

@bartekpacia
Copy link
Collaborator

bartekpacia commented Jun 26, 2024

it would still need to be duplicated in the Fastfile because some steps are not supported in Android, but are in iOS, or vice-versa

This doesn't really matter, you can have iOS-specific and Android-specific steps in a single Fastfile, e.g.:

platform :android do
  desc 'Upload a new Android testing build to Google Play'
  lane :deploy_tst do
    # ...
  end
end

platform :ios do
  desc 'Upload a new iOS testing build to TestFlight'
  lane :deploy_tst do
    # ...
  end
end

The above could be run with:

bundle exec fastlane trigger android deploy_tst
# or
bundle exec fastlane trigger ios deploy_tst

@bartekpacia
Copy link
Collaborator

Another good idea is to use a Ruby linter for to use for Fastfiles – Rubocop. I can help with setup, it's pretty simple anyway:)

@limwa
Copy link
Member Author

limwa commented Jun 26, 2024

That is my point, although the lanes are all in one file, most of them will still need to have an android and ios variants. I'll see what is possible in this regard, but since the two-fastlane approach is the recommended one, I'm inclined to sticking by it (since it is better for the future maintainability of the project - more people will more easily understand what is going on)

@bartekpacia
Copy link
Collaborator

Sure, I see you and understand the preference for going with the docs.

@@ -0,0 +1 @@
https://tiago-falves.github.io/UNI-Privacy-Policy/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be a niaefeup link?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe... It certainly would look more professional!

@@ -0,0 +1 @@
A FEUP no teu bolso
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to change that, for sure

@@ -0,0 +1 @@
https://github.com/NIAEFEUP/project-schrodinger/issues
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

project-schrodinger

@@ -0,0 +1 @@
testeteste123!
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add GH action to automatically deploy to AppStore and TestFlight
5 participants