nimblehq / flutter-templates

A repository contains Flutter templates that are used by Nimble developers
MIT License
23 stars 4 forks source link

[#222] Add new workflow to automate the mason bundle updating process after modifying the bundle config #247

Closed nmint8m closed 1 year ago

nmint8m commented 1 year ago

What happened 👀

After testing the newly generated project has passed, we need a job to generate the Mason bundles, then commit and push in cases there're any changes.

This PR is to create that automated job of the CI workflow.

Insight 📝

According to the requirement, we should create a new workflow (generate_mason_bundle.yml). However, if we create a brand new workflow, we will need to use the workflow_dispatch to trigger the generate_mason_bundle.yml workflow inside the test.yml workflow. That approach still resolves our issue, but it will be overused in this case.

According to this document, I think we just need to define a new job named generate_mason_bundle inside the test.yml workflow:

A workflow run is made up of one or more jobs, which run in parallel by default. To run jobs sequentially, you can define dependencies on other jobs using the jobs.<job_id>.needs keyword.

So technically, I think the approach for this task in the test.yml file is that:

...
jobs:
  test:
  ...
  generate_mason_bundle:
    # The job generate_mason_bundle identify that the job test must complete successfully
    # before this generate_mason_bundle job will run
    needs: test
    ...

Proof Of Work 📹

When the Mason bundle does NOT have changes

image

When the Mason bundle has changes

image image image
luongvo commented 1 year ago

Hi @nmint8m, there are 2 issues left here 👋