Skip to content

Commit 5b4a091

Browse files
committed
Migrate release process to GitHub Actions
Complete migration to GitHub Actions. See gh-
1 parent 0d16661 commit 5b4a091

File tree

2 files changed

+64
-2
lines changed

2 files changed

+64
-2
lines changed

.github/artifacts.spec

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"files": [
3+
{
4+
"aql": {
5+
"items.find": {
6+
"$and": [
7+
{
8+
"@build.name": "${buildName}",
9+
"@build.number": "${buildNumber}",
10+
"name": {
11+
"$nmatch": "*.zip"
12+
},
13+
"name": {
14+
"$nmatch": "*.zip.asc"
15+
}
16+
}
17+
]
18+
}
19+
},
20+
"target": "nexus/"
21+
}
22+
]
23+
}

.github/workflows/promote.yml

+41-2
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,44 @@ jobs:
3333
name: Promote
3434
runs-on: ubuntu-latest
3535
steps:
36-
- name: Promote
37-
run: echo "Promote happens here"
36+
- name: Check Out
37+
uses: actions/checkout@v4
38+
- name: Set Up JFrog CLI
39+
uses: jfrog/setup-jfrog-cli@7c95feb32008765e1b4e626b078dfd897c4340ad # v4.1.2
40+
env:
41+
JF_ENV_SPRING: ${{ secrets.JF_ARTIFACTORY_SPRING }}
42+
- name: Download Release Artifacts
43+
run: jf rt download --spec ./.github/artifacts.spec --spec-vars 'buildName=${{ format('spring-javaformat-{0}', inputs.version) }};buildNumber=${{ inputs.build-number }}'
44+
- name: Check Maven Central Sync Status
45+
id: check-sync-status
46+
run: |
47+
url=${{ format('https://repo.maven.apache.org/maven2/io/spring/javaformat/spring-javaformat/{0}/spring-javaformat-{0}.pom', inputs.version) }}
48+
status_code=$( curl --write-out '%{http_code}' --head --silent --output /dev/null ${url} )
49+
if [ "${status_code}" != 200 ] && [ "${status_code}" != 404 ]; then
50+
echo "Unexpected status code ${status_code}"
51+
exit 1
52+
fi
53+
echo "status-code=${status_code}" >> $GITHUB_OUTPUT
54+
- name: Sync to Maven Central
55+
if: ${{ steps.check-sync-status.outputs.status-code == '404' }}
56+
uses: spring-io/[email protected]
57+
with:
58+
username: ${{ secrets.OSSRH_S01_TOKEN_USERNAME }}
59+
password: ${{ secrets.OSSRH_S01_TOKEN_PASSWORD }}
60+
staging-profile-name: ${{ secrets.OSSRH_S01_STAGING_PROFILE }}
61+
create: true
62+
upload: true
63+
close: true
64+
release: true
65+
generate-checksums: true
66+
- name: Await Maven Central Sync
67+
if: ${{ steps.check-sync-status.outputs.status-code == '404' }}
68+
run: |
69+
url=${{ format('https://repo.maven.apache.org/maven2/io/spring/javaformat/spring-javaformat/{0}/spring-javaformat-{0}.pom', inputs.version) }}
70+
echo "Waiting for $url"
71+
until curl --fail --head --silent $url > /dev/null
72+
do
73+
echo "."
74+
sleep 60
75+
done
76+
echo "$url is available"

0 commit comments

Comments
 (0)