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

Track flutter version in a file #308

Merged
merged 2 commits into from
Oct 5, 2023
Merged

Conversation

EduardGomezEscandell
Copy link
Contributor

@EduardGomezEscandell EduardGomezEscandell commented Oct 5, 2023

This also leaves the door open for tracking any other version or value we want.

How to use it

Go to tools/versions.json and append your entry:

{
    // other stuff
    "cool-version": "1.3.5",
}

To use it:

- name: Load flutter version
  id: load
  uses: ./.github/actions/load-json
  with:
    path: tools/versions.json
 
- name: My cool action
  with:
     cool-version: ${{ steps.load.outputs.data.cool-version }} 

Nested data!

You can nest keys:

{
    // other stuff
    "cool-version": {
        "windows": "1.3.5",
        "ubuntu": "1.3.6",
    }
}

then access them:

- name: My cool action
  with:
     cool-version: ${{ steps.load.outputs.data.cool-version.windows }} 

UDENG-1500

@EduardGomezEscandell EduardGomezEscandell force-pushed the track-versions branch 6 times, most recently from 8fb097b to 61ac921 Compare October 5, 2023 10:13
@EduardGomezEscandell EduardGomezEscandell self-assigned this Oct 5, 2023
@EduardGomezEscandell EduardGomezEscandell marked this pull request as ready for review October 5, 2023 12:02
@EduardGomezEscandell EduardGomezEscandell requested a review from a team October 5, 2023 12:02
Copy link
Contributor

@CarlosNihelton CarlosNihelton left a comment

Choose a reason for hiding this comment

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

Just noticed a typo.

.github/actions/load-json/action.yaml Show resolved Hide resolved
tools/versions.json Outdated Show resolved Hide resolved
also switched the key to _doc to make it more obvious that it is not a
key to be used.
Copy link
Contributor

@CarlosNihelton CarlosNihelton left a comment

Choose a reason for hiding this comment

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

I really enjoyed the json trick.

Copy link
Collaborator

@didrocks didrocks left a comment

Choose a reason for hiding this comment

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

Contrary to Carlos, I’m not a big fan to allow the nesting trick, especially if this starts to be abuse setting version per-platform (the simplest, the better, we should just align). However, let’s see how it goes in practice, and I hope this will not going to be used.

Nicely done! I think we can at the next physicial sprint gather and propose it for our common repo!

@EduardGomezEscandell
Copy link
Contributor Author

{
    "why": {
        "would": {
            "you": {
                "not": {
                    "love": {
                        "this?"
                    }
                }
            }
        }
    } 
}

😆

Agree on avoiding abusing this, but it can occasionally be useful, particularly because this action can be used to load any arbitrary data without much effort.

@EduardGomezEscandell EduardGomezEscandell merged commit 3db7453 into main Oct 5, 2023
33 checks passed
@EduardGomezEscandell EduardGomezEscandell deleted the track-versions branch October 5, 2023 15:34
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.

3 participants