umbraco / UmbPack

13 stars 13 forks source link

wildcard version numbers when publishing? #26

Closed PeteDuncanson closed 4 years ago

PeteDuncanson commented 4 years ago

Been playing with the "push" command. It all works which is lovely.

However I seeing a problem with this going forward. How do I get the version number into my build? Currently I'm just using some scripts in my package.json but the "push" command requires a version number so I'm having to hardcode that into my scripts. This isn't ideal.

Wondered if I can just give it a glob or regex and it then would use that. This would allow me to use wild card filenames:

umbpack push -k [MY-API-KEY] ./dist/TestPackage_*.zip

That way I wouldn't have to keep updating my script. This would only "work" if there is only one match in the folder. If that was the case then I would be happy if it failed with a helpful message:

"Multiple files match your package path (./dist/TestPackage_*.zip), either make your path more specific or remove unwanted files (did you forget to clean up old packages?)"

If the tool needs to know the version number well that should be in the package.xml file anyway so it could get it from there.

jmayntzhusen commented 4 years ago

Hmm well what the tool really needs is the packagename. Which currently is generated including a version when using the pack command, but we recently added a name override command as well.

So not entirely sure on the use case here? 🙂

Most people would probably auto generate a version and include that in the name as for example here: https://github.com/Matthew-Wise/umbraco-forms-rte/blob/master/.github/workflows/build.yml#L51

And as you mention if you don't specify a version it will fall back to the package.xml version and add that to the name in the Pack command.