Handling nextRelease version in semantic release
so I have been reading the docs and kind of got a glimpse of
what I should do, but no real grasp of how I can do it.
Here is my problem:
- I am using semantic release to publish my package to npm
- I also have contract testing in place with Pact.
- I would like my Pacts published after the release, if successful, with the same version as the new version
How can I do that easily?
I have looked at the docs, and understood that I could use the exec
plugin, however, I find it not clear how I should configure semantic-release to behave exactly the same as now, only exposing the version as, at the very least, an env variable, and couldn't find examples of people doing that.
I could use hooks, but I am concerned that if a npm publish does not happen for some reasons, I would still get my pact published with the next version, which wouldn't exactly exist. Any suggestions here?
It seems I could also write my own JS script (see https://github.com/semantic-release/semantic-release/blob/3cc62f0318ff8917fcdc7cebe890da9dbaa7b3f9/docs/developer-guide/js-api.md) to do this as well as handling the version, but I am not certain what this example does and what it covers regarding the current behaviour.
I guess I could also write my own pact plugin too, but that's even more next level into having to understand how the internals of semantic-release work.
So I am after some examples/experience sharing, and maybe an easy-peasy solution to have that working in less than 30 minutes :)
Thanks
PS: sorry for posting here, but it seems the issues of semantic-release are not really made for support questions.
pact semantic-release
add a comment |
so I have been reading the docs and kind of got a glimpse of
what I should do, but no real grasp of how I can do it.
Here is my problem:
- I am using semantic release to publish my package to npm
- I also have contract testing in place with Pact.
- I would like my Pacts published after the release, if successful, with the same version as the new version
How can I do that easily?
I have looked at the docs, and understood that I could use the exec
plugin, however, I find it not clear how I should configure semantic-release to behave exactly the same as now, only exposing the version as, at the very least, an env variable, and couldn't find examples of people doing that.
I could use hooks, but I am concerned that if a npm publish does not happen for some reasons, I would still get my pact published with the next version, which wouldn't exactly exist. Any suggestions here?
It seems I could also write my own JS script (see https://github.com/semantic-release/semantic-release/blob/3cc62f0318ff8917fcdc7cebe890da9dbaa7b3f9/docs/developer-guide/js-api.md) to do this as well as handling the version, but I am not certain what this example does and what it covers regarding the current behaviour.
I guess I could also write my own pact plugin too, but that's even more next level into having to understand how the internals of semantic-release work.
So I am after some examples/experience sharing, and maybe an easy-peasy solution to have that working in less than 30 minutes :)
Thanks
PS: sorry for posting here, but it seems the issues of semantic-release are not really made for support questions.
pact semantic-release
add a comment |
so I have been reading the docs and kind of got a glimpse of
what I should do, but no real grasp of how I can do it.
Here is my problem:
- I am using semantic release to publish my package to npm
- I also have contract testing in place with Pact.
- I would like my Pacts published after the release, if successful, with the same version as the new version
How can I do that easily?
I have looked at the docs, and understood that I could use the exec
plugin, however, I find it not clear how I should configure semantic-release to behave exactly the same as now, only exposing the version as, at the very least, an env variable, and couldn't find examples of people doing that.
I could use hooks, but I am concerned that if a npm publish does not happen for some reasons, I would still get my pact published with the next version, which wouldn't exactly exist. Any suggestions here?
It seems I could also write my own JS script (see https://github.com/semantic-release/semantic-release/blob/3cc62f0318ff8917fcdc7cebe890da9dbaa7b3f9/docs/developer-guide/js-api.md) to do this as well as handling the version, but I am not certain what this example does and what it covers regarding the current behaviour.
I guess I could also write my own pact plugin too, but that's even more next level into having to understand how the internals of semantic-release work.
So I am after some examples/experience sharing, and maybe an easy-peasy solution to have that working in less than 30 minutes :)
Thanks
PS: sorry for posting here, but it seems the issues of semantic-release are not really made for support questions.
pact semantic-release
so I have been reading the docs and kind of got a glimpse of
what I should do, but no real grasp of how I can do it.
Here is my problem:
- I am using semantic release to publish my package to npm
- I also have contract testing in place with Pact.
- I would like my Pacts published after the release, if successful, with the same version as the new version
How can I do that easily?
I have looked at the docs, and understood that I could use the exec
plugin, however, I find it not clear how I should configure semantic-release to behave exactly the same as now, only exposing the version as, at the very least, an env variable, and couldn't find examples of people doing that.
I could use hooks, but I am concerned that if a npm publish does not happen for some reasons, I would still get my pact published with the next version, which wouldn't exactly exist. Any suggestions here?
It seems I could also write my own JS script (see https://github.com/semantic-release/semantic-release/blob/3cc62f0318ff8917fcdc7cebe890da9dbaa7b3f9/docs/developer-guide/js-api.md) to do this as well as handling the version, but I am not certain what this example does and what it covers regarding the current behaviour.
I guess I could also write my own pact plugin too, but that's even more next level into having to understand how the internals of semantic-release work.
So I am after some examples/experience sharing, and maybe an easy-peasy solution to have that working in less than 30 minutes :)
Thanks
PS: sorry for posting here, but it seems the issues of semantic-release are not really made for support questions.
pact semantic-release
pact semantic-release
asked Nov 21 '18 at 16:54
MoustachisteMoustachiste
14510
14510
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
You can simply use @semantic-release/exec
in an extra publish step that comes after @semantic-release/npm
and @semantic-release/github
:
{
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/npm",
"@semantic-release/github",
["@semantic-release/exec", {
"publishCmd": "publish-pacts ${nextRelease.version}"
}],
]
}
This way the script publish-pacts
will be called with the release version as first parameter for each new release, only when npm and github releases are successful.
thanks, that was the clarification I needed. Everything works fine
– Moustachiste
Nov 26 '18 at 18:25
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53417010%2fhandling-nextrelease-version-in-semantic-release%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You can simply use @semantic-release/exec
in an extra publish step that comes after @semantic-release/npm
and @semantic-release/github
:
{
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/npm",
"@semantic-release/github",
["@semantic-release/exec", {
"publishCmd": "publish-pacts ${nextRelease.version}"
}],
]
}
This way the script publish-pacts
will be called with the release version as first parameter for each new release, only when npm and github releases are successful.
thanks, that was the clarification I needed. Everything works fine
– Moustachiste
Nov 26 '18 at 18:25
add a comment |
You can simply use @semantic-release/exec
in an extra publish step that comes after @semantic-release/npm
and @semantic-release/github
:
{
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/npm",
"@semantic-release/github",
["@semantic-release/exec", {
"publishCmd": "publish-pacts ${nextRelease.version}"
}],
]
}
This way the script publish-pacts
will be called with the release version as first parameter for each new release, only when npm and github releases are successful.
thanks, that was the clarification I needed. Everything works fine
– Moustachiste
Nov 26 '18 at 18:25
add a comment |
You can simply use @semantic-release/exec
in an extra publish step that comes after @semantic-release/npm
and @semantic-release/github
:
{
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/npm",
"@semantic-release/github",
["@semantic-release/exec", {
"publishCmd": "publish-pacts ${nextRelease.version}"
}],
]
}
This way the script publish-pacts
will be called with the release version as first parameter for each new release, only when npm and github releases are successful.
You can simply use @semantic-release/exec
in an extra publish step that comes after @semantic-release/npm
and @semantic-release/github
:
{
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/npm",
"@semantic-release/github",
["@semantic-release/exec", {
"publishCmd": "publish-pacts ${nextRelease.version}"
}],
]
}
This way the script publish-pacts
will be called with the release version as first parameter for each new release, only when npm and github releases are successful.
answered Nov 24 '18 at 19:33
Pierre VanduynslagerPierre Vanduynslager
13614
13614
thanks, that was the clarification I needed. Everything works fine
– Moustachiste
Nov 26 '18 at 18:25
add a comment |
thanks, that was the clarification I needed. Everything works fine
– Moustachiste
Nov 26 '18 at 18:25
thanks, that was the clarification I needed. Everything works fine
– Moustachiste
Nov 26 '18 at 18:25
thanks, that was the clarification I needed. Everything works fine
– Moustachiste
Nov 26 '18 at 18:25
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53417010%2fhandling-nextrelease-version-in-semantic-release%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown