did you ever get a chan…
did you ever get a chance to make a demo repo and/or some documentation for your semantic-release-plus package? I spent about 15 minutes investigating yesterday and couldn’t find what I needed
Responses:
- not yet but I am working on it today. Can you tell me if there is a way to pass an argument through to run-commands ie: I want to be able to run
nx release ng-lib0 --dry-run
and that will result in passing thedry-run
flag through to the run-commnads which is runningyarn run semantic-release --extends=./apps/ng/lib0/release.config.js
but then appends--dry-run
to the end
https://nx.dev/web/api/workspace/builders/run-commands
--args
is what you want I think
alright I did play with that and looked at that page but I must be missing something… I cant quite get it correct. It’s just a nice to have so I can move on.
"echo": {
"builder": "@nrwl/workspace:run-commands",
"options": {
"commands": [
{
"command": "echo {args.extraArgs}"
}
]
}
},
And then in the command line:
nx run products:echo --args="--extraArgs=something"
This executes echo something
and the output is something
how about if I wanted to specify 3 args --no-ci --dry-run --branches=feature-branch
nx run products:echo --args="--extraArgs='--no-ci --dry-run --branches=feature-branch'"
hm that didn’t work
"echo": {
"builder": "@nrwl/workspace:run-commands",
"options": {
"commands": [
{
"command": "echo {args.extraArgs1} {args.extraArgs2} {args.extraArgs3}"
}
]
}
},
Terminal:
nx run products:echo --args='--extraArgs1=--no-ci --extraArgs2=--dry-run --extraArgs3=--branches=feature-branch
not great, but it works
thanks, I may include a couple extra args but the number of optional args that can be passed to semantic-release makes that approach a little hard.
I was kind of looking for a solution similar to how npm run command
allows you to pass args through to the command by using an extra --
ie npm run release -- --dry-run --no-ci
yeah, that’s what I thought –args would do, but apparently it chokes on space characters. I think its worth opening an issue
Agreed, I will see if I can get something written up later today
what CI service do you use?
I haven’t picked yet. Something free for oss and easy to integrate with GitHub
you then just run nx release ng-app
I don’t get the luxury of using GitHub at my job so I don’t play with the GitHub Semantic Release Plugin all that often so don’t know it’s in’s and outs
with some custom schematics it would be easier to pass that data
but the solution you provided to me a while ago worked fine for me :slightly_smiling_face:
Yea.. I need to:
- find the time
- figure out how to write a schematic
- figure out a good way to extract the information from NX. nx has a lot of function under the hood for working with the workspace and I think I could extract the information from there. But the fall back is run a dep-graph report and combine that with the angular/workspace.json to get any other info.
nx print-affected
gives a lot of json describing what Nx knows about your dependency graph. That might be what you’re looking for
Thanks for the reminder I was looking at that when looking at how the distributed pipeline was working
It seams that my changelog file is causing additional releases, also in the changelog I see lines appear for other libraries
You will get commits in your changelog for all commits included in the commit paths
Did you add changelog.md to your .nxignore file?
yes i did
Do you have chore commit types configured to create a release?
is your repo public?
no it’s a private one