Replies: 5 comments 2 replies
-
As a note, I've fixed my issue using |
Beta Was this translation helpful? Give feedback.
-
You do not need to update the version in package.json. For a fully implemented typescript package release flow you can view the release config on the @semantic-release/wordpress package. Feel free to copy everything you need from there. |
Beta Was this translation helpful? Give feedback.
-
This part is clear to me. My package.json version does get updated but only on the compiled version, not on the source, because I’m pointing the root dir to be dist. Since only the package.json in dist is updated, I need to still copy the new version to the main package.json. In the same way, changelog is only updated in dist and not in the source so I also need to copy this file from dist to source after semantic release updates it. The implementation in the branch I posted above is following a recipe from the documentation of semantic-release/npm to copy the files using the postversion hook, but the hook is not triggered
…--
Marcos Mellado
Sent from mobile
On Sat, Sep 9, 2023 at 13:43, Sibin Grašić ***@***.***(mailto:On Sat, Sep 9, 2023 at 13:43, Sibin Grašić <<a href=)> wrote:
You do not need to update the version in package.json. @semantic-release/npm package does that automatically for you.
For a fully implemented typescript package release flow you can view the release config on the ***@***.***/wordpress](/semantic-release/wordpress) package. Feel free to copy everything you need from there.
—
Reply to this email directly, [view it on GitHub](#2944 (comment)), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/AACKXBLV5DOPAEHXE4NFPU3XZRI5LANCNFSM6AAAAAA4PBGSJY).
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
it seems like you are attempting to follow a path that is far more complicated than it sounds like you need. first, i would recommend avoiding use of beyond that, we also recommend against use of the git and changelog plugins unless you absolutely need them because adding commits during the release process does significantly complicate things, even though semantic-release handles adding them as gracefully as is possible. since you are already using github releases, you could prefer publishing release notes there instead of to a |
Beta Was this translation helpful? Give feedback.
-
What @travi said. You can also use the files directive in My advice would be to copy the flow from there 1:1 and see if that solves the issues you're having. |
Beta Was this translation helpful? Give feedback.
-
I'm using semantic release to automate the release flow of an npm library I'm trying to publish. Things work fine with 1 exception.
My library is written in typescript which means I need to build it before publishing it. This means the published directory is not the source, but a
dist
directory that is created on build prior to me triggering semantic-release.I've configured
semantic-release/npm
andsemantic-release/git
to focus on the dist directory, and this works fine, the published files are only those in thedist
directory. However, to make sure that everything is up to date, after semantic-release/npm updates package.json, I want to also update the version in the root of the project. I read that this can be accomplished using thepostversion
hook via npm scripts. However, this doesn't seem to be happening, or at least, at the end of the flow, it's not attempting to make a commit with the updated CHANGELOG and package.json files.This is the repository https://github.com/velupjs/velup/tree/v1.0.0-alpha.1 (alpha branch is where I'm doing this as the library is not ready for release yet, specially as I'm testing this release flow).
Any ideas on what I'm missing? My main goal is to make sure that the version is updates on both
package.json
anddist/package.json
, but only the contents ofdist
are published to npmBeta Was this translation helpful? Give feedback.
All reactions