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

Support VERSION file #1

Open
slominskir opened this issue Dec 11, 2024 · 1 comment
Open

Support VERSION file #1

slominskir opened this issue Dec 11, 2024 · 1 comment

Comments

@slominskir
Copy link
Member

slominskir commented Dec 11, 2024

All the other workflows function via a VERSION file that the build tools can read:

Java:
https://github.com/JeffersonLab/java-workflows/blob/33e897c6a282e23be00ea1668255246f91b03527/build.gradle#L7

Python:
https://github.com/JeffersonLab/jaws-libp/blob/52e756c590d260a1116640b11e078dd591485f9f/pyproject.toml#L7
and
https://github.com/JeffersonLab/jaws-libp/blob/52e756c590d260a1116640b11e078dd591485f9f/pyproject.toml#L39-L40

This apparently isn't going to work in NodeJS with NPM:
npm/npm#7118

At the moment this means users need to bump the version in package.json and commit FIRST, then proceed with VERSION file.

Note: You also must run npm i to bump the version in package-lock.json with the value updated in package.json. The node version command can help here to do both simultaneously, but it also creates a Git tag as well by default, which we don't want if we rely on a separate GitHub action for that.

@slominskir
Copy link
Member Author

slominskir commented Dec 11, 2024

We could consider not using a VERSION file and only using package.json, but not only does that differ from all other workflows, it also means you can't trigger on file updates without checking if the version changed as it could be just dependencies were changed, and user is not attempting to release. The beauty of the VERSION file is it unambiguously says we're trying to release when it changes.

If we do pursue the alternate workflow there are actions for parsing the package.json version in GitHub Action workflow: https://github.com/marketplace/actions/get-current-package-version

Another option is to use Git Hooks: https://git-scm.com/book/ms/v2/Customizing-Git-Git-Hooks

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