-
You may read version from package.json and write it to a file inside job workspace, say
buildVersion, then add a create tag step with tag name set to@file:buildVersion -
Yep thanks it worked! For future reference I will just add that I had to write the version to the job workspace by using the
$ONEDEV_WORKSPACEenv var:sed 's/.*"version": "\(.*\)".*/\1/;t;d' ./package.json > "$ONEDEV_WORKSPACE"/buildversionI was then able to use
@file:buildversion@in a seperate step -
Thanks for sharing
-
Previous Value Current Value Open
Closed
| Type |
Question
|
| Priority |
Normal
|
| Assignee | |
| Labels |
No labels
|
Issue Votes (0)
Hello there,
I have a really nice pipeline setup to automatically release my Unity packages to our npm repository when I make changes to the package.json npm file. But there is one improvement I would like to have so I don't have to do it manually but I didn't find how to do it yet or if it is even possible.
Right now, the build pipeline detects a version change in the package.json file in my repository and triggers the npm publish command to push it automatically, which is quite nice. But I would like to tag those commits with the current version that is in the package.json file.
Is it possible to do this with OneDev? Like is it possible to write to a variable in the publish step, and then read it in another build step ?