jutzig / github-release-plugin

uses the github release api to upload files
69 stars 24 forks source link

Unable to Skip Snapshots #50

Open adamretter opened 3 years ago

adamretter commented 3 years ago

The problem we are facing is that this plugin runs for both -SNAPSHOT versions and release versions.

We build and publish development snapshots frequently to our Maven repo but we do not want to upload those to GitHub releases. We only want to upload final versions to GitHub releases. I can work around this by placing this in a non-active profile and passing a flag for releases, but an option to skip SNAPSHOT versions would greatly simplify things.

...or just a -Dgithub.release.skip=true flag would also be enough, and we could set this when we do the SNAPSHOT builds.

jutzig commented 3 years ago

I'd say the most straight forward way is to bind the execution to a phase you only run in release and as you mentioned, a profile works too of course. Not sure it really needs another flag for that

adamretter commented 3 years ago

@jutzig The plugin is bound to our deploy phase.

This is used eventually by both: 1) our snapshot publish process mvn verify && mvn deploy 2) our release process -mvn release:prepare && mvn release:perform

I don't think there is a suitable phase that is distinct to one of the above but not the other.

jutzig commented 3 years ago

It currently deploys a pre-release for non release versions and a release for release versions. If you only want the release, you could e.g. use the site lifecycle with something like deploy-site as the phase, since it's pushing to a public site anyway so to speak. That being said, I'd be OK with a general skip flag (skip snapshot seems too specific to me) if you want to provide a pull request for that.