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

When exactly is publishCmd run? #115

Open
khaledosman opened this issue Oct 20, 2020 · 2 comments
Open

When exactly is publishCmd run? #115

khaledosman opened this issue Oct 20, 2020 · 2 comments

Comments

@khaledosman
Copy link

khaledosman commented Oct 20, 2020

I would like to run a command that uses the newly updated package.json version and write it into a file that is added to git to be included as part of the release commit, is it possible to do so with exec?

My use case is that I'm building a hybrid app where semantic-release would bump the package.json version, I would then like to use the new package.json version to update the native android & ios versions based on that and push that to git as part of the release commit, is that something I can accomplish with exec, or do I manually need to trigger my script after release as a separate commit?

I tried setting that as part of the publishCmd but it didn't work, it seems to be run either too early before the new package.json version is set or too late after the commit has already been made
PS: npmPublish is set to false

@khaledosman khaledosman changed the title When exactly is prepareCmd run? When exactly is publishCmd run? Oct 20, 2020
@felipecrs
Copy link

I think you should call the script which changes the files with @semantic-release/exec's prepareCmd, and then, include the files to be committed with @semantic-release/git, there is an option for adding custom files.

@EvanCarroll
Copy link

It would be great to at least document when these hooks run (before or after) and what they run before or after. It's not clear what a "prepare" hook even hooks into, and when the hook fires (before or after).

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

3 participants