Skip to content

Commit 9a286b2

Browse files
committed
Merge branch 'v1'
2 parents d4f135d + d212e84 commit 9a286b2

File tree

2 files changed

+42
-15
lines changed

2 files changed

+42
-15
lines changed

.github/workflows/deploy-artifacts.yml

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -77,45 +77,48 @@ jobs:
7777
if [[ "$deploy_location" = "true" ]] ; then
7878
if [[ "$VERSION" =~ "-SNAPSHOT" ]] ; then
7979
# always default -SNAPSHOT to artifactory
80-
deploy_location=libs-snapshot-local
80+
deploy_location=artifactory
8181
elif [[ "$DEFAULT_PUBLISH_MILESTONE_CENTRAL" = "true" ]] ; then
8282
# if configured, non -SNAPSHOT go to central
8383
deploy_location=central
8484
elif [[ "$VERSION" =~ "-" ]] ; then
8585
# -M\d+, and -RC\d+ all go to artifactory by default to remain passive
8686
# Newer generations will only deploy -SNAPSHOT to artifactory, but they must specify default-publish-milestone-central=true
87-
deploy_location=libs-milestone-local
87+
deploy_location=artifactory
8888
else
8989
deploy_location=central
9090
fi
9191
fi
9292
echo "deploy_location=$deploy_location" >> $GITHUB_OUTPUT
93+
- name: Deploy to Artifactory
94+
if: ${{ steps.deploy-location.outputs.deploy_location == 'artifactory' }}
95+
env:
96+
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_PRIVATE_KEY }}
97+
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.GPG_PASSPHRASE }}
98+
ARTIFACTORY_BUILD_NAME: ${{ github.event.repository.name }}-${{ steps.branch-name.outputs.branch }}
99+
ARTIFACTORY_BUILD_NUMBER: ${{ github.run_id }}
100+
ARTIFACTORY_BUILD_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
101+
ARTIFACTORY_USER_AGENT_NAME: GitHub Actions
102+
ARTIFACTORY_USER_AGENT_VERSION: Unknown
103+
ARTIFACTORY_VCS_REVISION: ${{ github.sha }}
104+
run: ./gradlew artifactoryPublish -PartifactoryUsername="$ARTIFACTORY_USERNAME" -PartifactoryPassword="$ARTIFACTORY_PASSWORD" --stacktrace
93105
- name: Stage Local Artifacts for Publishing to Central
106+
if: ${{ steps.deploy-location.outputs.deploy_location == 'central' }}
94107
env:
95108
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_PRIVATE_KEY }}
96109
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.GPG_PASSPHRASE }}
97110
run: |
98111
./gradlew publishAllPublicationsToLocalRepository --stacktrace
99-
- name: Deploy to Artifactory
100-
if: ${{ steps.deploy-location.outputs.deploy_location != 'artifactory' }}
101-
uses: spring-io/[email protected]
102-
with:
103-
uri: "https://repo.spring.io"
104-
repository: ${{ steps.deploy-location.outputs.deploy_location }}
105-
build-name: ${{ github.event.repository.name }}-${{ steps.branch-name.outputs.branch }}
106-
build-uri: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
107-
username: ${{ secrets.ARTIFACTORY_USERNAME }}
108-
password: ${{ secrets.ARTIFACTORY_PASSWORD }}
109-
vcs-revision: ${{ github.sha }}
110-
folder: build/publications/repos
112+
# rm checksums to work around https://github.com/spring-io/central-publish-action/issues/11
113+
find -name "*.md5" | xargs rm -f
114+
find -name "*.sha*" | xargs rm -f
111115
- name: Publish Staged Artifacts to Central
112116
if: ${{ steps.deploy-location.outputs.deploy_location == 'central' }}
113117
uses: spring-io/[email protected]
114118
with:
115119
token-name: ${{ secrets.CENTRAL_TOKEN_USERNAME }}
116120
token: ${{ secrets.CENTRAL_TOKEN_PASSWORD }}
117121
dir: build/publications/repos
118-
fail-on-existing-checksums: false
119122
- id: artifacts-deployed
120123
name: Artifacts Deployed
121124
run: echo "result=true" >> $GITHUB_OUTPUT

.github/workflows/perform-release.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,30 @@ jobs:
8181
- id: has-oss-support
8282
name: Check OSS Support (for current branch)
8383
run: echo "result=$(./gradlew -q checkBranchHasOssSupport -Pbranch=$BRANCH -PgitHubAccessToken=$TOKEN)" >> $GITHUB_OUTPUT
84+
- name: Wait for Milestone Artifacts
85+
if: ${{ contains(inputs.project-version, '-RC') || contains(inputs.project-version, '-M') }}
86+
env:
87+
VERSION: ${{ inputs.project-version }}
88+
run: |
89+
echo "Wait for artifacts of $REPO@$VERSION to appear on milestone repository ($MILESTONE_REPO)."
90+
until curl -f -s $MILESTONE_REPO/$ARTIFACT_PATH/$VERSION/ > /dev/null
91+
do
92+
sleep 30
93+
echo "."
94+
done
95+
echo "Artifacts for $REPO@$VERSION have been released to milestone repository ($MILESTONE_REPO)."
96+
- name: Wait for Release Artifacts
97+
if: ${{ !contains(inputs.project-version, '-RC') && !contains(inputs.project-version, '-M') }}
98+
env:
99+
VERSION: ${{ inputs.project-version }}
100+
run: |
101+
echo "Wait for artifacts of $REPO@$VERSION to appear on release repository ($RELEASE_REPO)."
102+
until curl -f -s $RELEASE_REPO/$ARTIFACT_PATH/$VERSION/ > /dev/null
103+
do
104+
sleep 30
105+
echo "."
106+
done
107+
echo "Artifacts for $REPO@$VERSION have been released to release repository ($RELEASE_REPO)."
84108
- name: Create GitHub Release
85109
env:
86110
VERSION: ${{ inputs.project-version }}

0 commit comments

Comments
 (0)