flutter-stripe / flutter_stripe

Flutter SDK for Stripe.
https://pub.dev/packages/flutter_stripe
940 stars 521 forks source link

Setup CI/CD pipeline #42

Closed albertus-stripe closed 3 years ago

albertus-stripe commented 3 years ago

Problem

We currently don't have a CI/CD pipeline set-up yet for regression testing and automatically building/deploying the package to pub.

I think as the project grows this is going to be important to make sure we are not breaking things and not having any "bus factor" on the project (any maintainer with write access on the repository should be able to easily deploy the package to pub.dev by creating a tag on the Git without too much troubles?)

Just a proposal to make sure that this repository and project scalable in the longer term.

Solution

  1. CI pipeline We need to have a CI pipeline for:

    • Running automated regression tests so that things don't break after someone makes a pull request (Though, this is dependant on #19 right now since we don't have good test coverage currently), both for unit tests and integration tests just like flutter/flutter repository.
  2. CD pipeline I think another pipeline that triggers on tag creation to automatically build the binary and package and publish it to pub would also be essential to this repository.

What do you think? Happy to take this task while also helping with testing and adding automated tests on the project \o/

remonh87 commented 3 years ago

Good one I think @jonasbark wanted to setup github actions right? I have also experience with codemagic if this is what we want.

albertus-stripe commented 3 years ago

+1 for GitHub Actions since it's more native to GitHub. I can take this on for GitHub actions if you want!

jamesblasco commented 3 years ago

Same here! Let's do Github Actions

@albertus-stripe Let us know how you plan to start it and how we can help. We can separate into smaller tasks and divide them between the three of us

For CD I think we could use melos. It is a very useful tool https://docs.page/invertase/melos/automated-releases

jonasbark commented 3 years ago

It's indeed on my todo after the next release with the payment sheet - I sure would love some help there :)

The focus could we the CD part, with the CI one (formatting, automated tests) being second

albertus-stripe commented 3 years ago

Reopening the issue since it got closed automatically by the PR on the CI work (my mistake for linking it on the PR, sorry!) I'd love to help with the CD pipeline as well! Since the melos work now has been finished. Will continue the discussion offline in our Slack!

albertus-stripe commented 3 years ago

Hey maintainers! @jonasbark @remonh87 @jamesblasco I have another (hopefully final) nitpick suggestion regarding the CD pipeline and how we do releases for this package. As I'm not really aware with how you guys do the current release process, I highly recommend sticking to Git tag versioning for all releases going forward. Then we should create a GitHub action pipeline that gets triggered on tag created/push events and build all the binary & publish the binary to pub.dev.

As it is right now, as a user of this library, I'm a little bit confused on how to find the release version of the package and the specific commit reference attached to a version.

It might also help to use a single version for all the packages (flutter_stripe, stripe, stripe_android, stripe_ios) for the sake of simplicity.

πŸŽ‰πŸŽ‰πŸŽ‰