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

Automate keeping this gem up to date by checking the official heroicons repo for new releases in a GitHub Action #36

Open
nickjj opened this issue Mar 2, 2023 · 0 comments

Comments

@nickjj
Copy link
Contributor

nickjj commented Mar 2, 2023

This is in reference to issue #33 where we may want to define a workflow to help keep this gem up to date based on new versions of heroicons being available from the official tailwindlabs/heroicons repo:

A daily or weekly script could:

  1. Check https://github.com/tailwindlabs/heroicons/releases/latest which redirects to the latest release
    • You can use GitHub's API to grab the specific version
  2. Modify your gem to store the version you're using so it can be compared to the latest version
    • Option 1: Use v2.0.16.json instead of icons.json, but this will make git diffing hard since the file name changed?
    • Option 2: Add a _version field to the icons.json, not bad but feels like it's mixing concerns of icons and metadata?
    • Option 3: Write a separate TAILWINDLABS_HEROICONS_VERSION file somewhere within the gem, pretty good?
  3. A script compares the latest version to any of the above options, if there's a difference:
    • Make a new branch in your repo
    • Clone https://github.com/tailwindlabs/heroicons
    • Copy all of the tailwindlabs/heroicons icons into your repo's icons folder
      • Is there a difference between src/ and optimized/?
    • Update your version based on step 2
    • Update your readme to reference the version from what I added in this issue's PR
    • Commit the changes and push the branch
    • Open a PR in your own repo so you can review it as a human

At this point you can merge it and cut a gem release. I don't know your workflow for updating the changelog but that step could be done manually in the PR or after you merge it but before you build a new gem.

Step 2's option 3 looks like the most appealing based on feedback from @abeidahmed.

As for testing the script:

For development I'd suggest creating it all as an offline script that you can run on the command line on your dev box without needing to push any commits. This way it can be tested in isolation with a number of different inputs. Then once it's good to go drop it into a GitHub Action.

As a first-time-end-to-end test maybe a 2nd private repo could be created just to make sure the GitHub Action portion works. I don't really know of a better way to test GitHub Actions unless you start looking into solutions like https://github.com/nektos/act (I haven't yet btw).

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

No branches or pull requests

1 participant