NIAEFEUP / uni

Mobile app designed to help students of the University of Porto to manage their academic life.
GNU General Public License v3.0
50 stars 18 forks source link

Ci/setup fastlane #1219

Open limwa opened 7 months ago

limwa commented 7 months ago

Closes #506

Sets up fastlane for the CI.

Review checklist

limwa commented 7 months ago
----------------------
--- 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
codecov[bot] commented 7 months ago

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 ```diff @@ Coverage Diff @@ ## develop #1219 +/- ## ======================================= - Coverage 17% 17% -0% ======================================= Files 229 229 Lines 6986 6986 ======================================= - Hits 1150 1149 -1 - Misses 5836 5837 +1 ```
bdmendes commented 7 months ago

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

limwa commented 7 months ago

@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!

bartekpacia commented 5 months ago

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 commented 5 months ago

@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 commented 5 months ago

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 commented 5 months ago

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 commented 5 months ago

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 commented 5 months ago

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