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

task: Add versioning & release controls [WIP] #13

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

chriddell
Copy link
Member

@chriddell chriddell commented Jun 25, 2024

This PR

...adds a skeleton of how we could approach versioning & releases for the package. It uses the changesets/action library from Atlassian.

The flow that this PR suggests is:

  1. Designer changes tokens in Token Studio
  2. Designer pushes changes to Github from Token Studio

  1. This triggers a Github Action, which will:
    1. perform any transformations necessary (e.g. style-dictionary)
    2. create a changeset file (changeset.md), which will contain a description of the changes made [1]
    3. apply the changeset file, remove it, and append the changes to changelog.md
    4. create a PR against main containing all of the above
  2. Developer approves the PR, code is merged to main
  3. This triggers another Github Action, which will publish a new version of the package to NPM [2]

Unsolved issues

[1] This PR doesn't contain a method for adding a custom description of the changes made. This should be possible - perhaps via the commit message we get from Token Studio Github Sync?

[2] This PR doesn't contain a method to control what kind of version (patch/minor/major) we release

Also, because all Token Studio changes will get pushed the same branch (token-studio), I think this could create issues with git conflicts, and a definite problem with naming collisions of the file we create at .changesets/changeset.md.

Testing

To test this, we need to:

  1. Create an npm token that can publish the packages in the repo
  2. Add it as a secret in the GitHub repo with the name NPM_TOKEN.
  3. Create a new branch token-studio
  4. Set up Github Sync from Token Studio

@chriddell
Copy link
Member Author

chriddell commented Jun 25, 2024

@skibinska @davidpmccormick would appreciate any thoughts on this approach if you have them!

I'm going to think about the "unsolved issues" tomorrow, but if you have any thoughts on those in particular I'd love to hear them.

@skibinska
Copy link
Member

@chriddell, I have two questions about testing steps:

  1. re: the npm token, it is a token that we create on our own npmjs accounts. I think this is correct since I don't have access to the Wellcome Trust npm account.

  2. Secret in a GitHub repo: are you referring to the steps for adding secrets in the GitHub repository?

@chriddell
Copy link
Member Author

@skibinska

  1. re: npm token - yes, one of us should create it on via our npmjs account (e.g. https://www.npmjs.com/settings/chriddell/tokens/granular-access-tokens/new). We should probably do this once we've create a new NPM package in the @wellcome-trust organisation (I can do this!)
  2. re: github token - yes, sorry, I linked the completely incorrect docs... sorry about that !

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.

2 participants