ci: adjust behavior of PUBLISH to be true for releases
Otherwise release builds never create the GitHub draft releases. Not unless a user explicitly stats a build with `PUBLISH: true`. Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
parent
09ac3e6a9e
commit
f0d79f3af0
|
@ -26,7 +26,7 @@ pipeline {
|
||||||
booleanParam(
|
booleanParam(
|
||||||
name: 'PUBLISH',
|
name: 'PUBLISH',
|
||||||
description: 'Trigger publishing of build results for nightly or release.',
|
description: 'Trigger publishing of build results for nightly or release.',
|
||||||
defaultValue: params.PUBLISH ?: false,
|
defaultValue: getPublishDefault(params.PUBLISH),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -120,3 +120,13 @@ def List genChoices(String previousChoice, List defaultChoices) {
|
||||||
choices.add(0, previousChoice)
|
choices.add(0, previousChoice)
|
||||||
return choices
|
return choices
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Helper that makes PUBLISH default to 'false' unless:
|
||||||
|
* - The build is for a release branch
|
||||||
|
* - A user explicitly specified a value
|
||||||
|
* Since release builds create and re-create GitHub drafts every time. */
|
||||||
|
def Boolean getPublishDefault(Boolean previousValue) {
|
||||||
|
if (env.JOB_NAME.startsWith('status-react/release')) { return true }
|
||||||
|
if (previousValue != null) { return previousValue }
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue