Skip to content

Commit df3075f

Browse files
committed
Add support for publishing milestones to Central
Closes gh-71
1 parent d2e4d74 commit df3075f

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

.github/workflows/deploy-artifacts.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ on:
77
description: Whether artifacts should be deployed (true|false|central|artifactory).
88
required: true
99
type: string
10+
default-publish-milestones-central:
11+
description: Whether the default for milestones & RCs should be deployed to Central
12+
required: false
13+
default: false
14+
type: boolean
1015
outputs:
1116
artifacts-deployed:
1217
description: Whether artifacts were actually deployed.
@@ -66,12 +71,19 @@ jobs:
6671
env:
6772
SHOULD_DEPLOY_ARTIFACTS: ${{ inputs.should-deploy-artifacts }}
6873
VERSION: ${{ steps.project-version.outputs.version }}
74+
DEFAULT_PUBLISH_MILESTONE_CENTRAL: ${{ inputs.default-publish-milestones-central }}
6975
run: |
7076
deploy_location="$SHOULD_DEPLOY_ARTIFACTS"
7177
if [[ "$deploy_location" = "true" ]] ; then
72-
if [[ "$VERSION" =~ "-" ]] ; then
73-
# -SNAPSHOT, -M\d+, and -RC\d+ all go to artifactory by default to remain passive
74-
# Newer generations will only deploy -SNAPSHOT to artifactory, but they must opt into central explicitly
78+
if [[ "$VERSION" =~ "-SNAPSHOT" ]] ; then
79+
# always default -SNAPSHOT to artifactory
80+
deploy_location=artifactory
81+
elif [[ "$DEFAULT_PUBLISH_MILESTONE_CENTRAL" = "true" ]] ; then
82+
# if configured, non -SNAPSHOT go to central
83+
deploy_location=central
84+
elif [[ "$VERSION" =~ "-" ]] ; then
85+
# -M\d+, and -RC\d+ all go to artifactory by default to remain passive
86+
# Newer generations will only deploy -SNAPSHOT to artifactory, but they must specify default-publish-milestone-central=true
7587
deploy_location=artifactory
7688
else
7789
deploy_location=central

0 commit comments

Comments
 (0)