-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate release process to GitHub Actions
Complete migration to GitHub Actions. See gh-
- Loading branch information
Showing
6 changed files
with
150 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: 'Publish Eclipse Update Site ' | ||
inputs: | ||
version: | ||
required: true | ||
build-number: | ||
required: true | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Stage | ||
id: stage | ||
shell: bash | ||
run: . ${{ github.action_path }}/publish-eclipse-update-site.sh; | ||
env: | ||
VERSION: "${{ inputs.version }}" | ||
BUILD_NUMBER: "${{ inputs.build-number }}" |
5 changes: 5 additions & 0 deletions
5
.github/actions/publish-eclipse-update-site/publish-eclipse-update-site.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
buildInfo=$( jfrog rt curl api/build/spring-javaformat-${VERSION}/${BUILD_NUMBER} ) | ||
groupId=$( echo ${build_info} | jq -r '.buildInfo.modules[0].id' | sed 's/\(.*\):.*:.*/\1/' ) | ||
version=$( echo ${build_info} | jq -r '.buildInfo.modules[0].id' | sed 's/.*:.*:\(.*\)/\1/' ) | ||
|
||
echo "Publishing Update Site ${groupId}:${version}" |
57 changes: 57 additions & 0 deletions
57
.github/actions/publish-eclipse-update-site/xpublish-eclipse-update-site.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
source $(dirname $0)/common.sh | ||
|
||
buildName=$( cat artifactory-repo/build-info.json | jq -r '.buildInfo.name' ) | ||
buildNumber=$( cat artifactory-repo/build-info.json | jq -r '.buildInfo.number' ) | ||
groupId=$( cat artifactory-repo/build-info.json | jq -r '.buildInfo.modules[0].id' | sed 's/\(.*\):.*:.*/\1/' ) | ||
version=$( cat artifactory-repo/build-info.json | jq -r '.buildInfo.modules[0].id' | sed 's/.*:.*:\(.*\)/\1/' ) | ||
|
||
echo "Publishing ${buildName}/${buildNumber} to Eclipse Update Site" | ||
curl \ | ||
-s \ | ||
--connect-timeout 240 \ | ||
--max-time 2700 \ | ||
-u ${ARTIFACTORY_USERNAME}:${ARTIFACTORY_PASSWORD} \ | ||
-f \ | ||
-H "X-Explode-Archive: true" \ | ||
-X PUT \ | ||
-T "artifactory-repo/io/spring/javaformat/io.spring.javaformat.eclipse.site/${version}/io.spring.javaformat.eclipse.site-${version}.zip" \ | ||
"https://repo.spring.io/javaformat-eclipse-update-site/${version}/" > /dev/null || { echo "Failed to publish" >&2; exit 1; } | ||
|
||
releasedVersions=$( curl -s -f -X GET https://repo.spring.io/api/storage/javaformat-eclipse-update-site | jq -r '.children[] | .uri' | cut -c 2- | grep '[0-9].*' | sort -V ) | ||
|
||
repositories="" | ||
while read -r releasedVersion; do | ||
echo "Adding repository for ${releasedVersion}" | ||
repositories="${repositories}<repository><url>https://repo.spring.io/javaformat-eclipse-update-site/${releasedVersion}</url><layout>p2</layout></repository>" | ||
done <<< "${releasedVersions}" | ||
|
||
pushd git-repo > /dev/null | ||
sed "s|##repositories##|${repositories}|" ci/scripts/publish-eclipse-update-site-pom-template.xml > publish-eclipse-update-site-pom.xml | ||
run_maven -f publish-eclipse-update-site-pom.xml clean package || { echo "Failed to publish" >&2; exit 1; } | ||
|
||
curl \ | ||
-s \ | ||
--connect-timeout 240 \ | ||
--max-time 2700 \ | ||
-u ${ARTIFACTORY_USERNAME}:${ARTIFACTORY_PASSWORD} \ | ||
-f \ | ||
-X PUT \ | ||
-T "target/repository/content.jar" \ | ||
"https://repo.spring.io/javaformat-eclipse-update-site/" > /dev/null || { echo "Failed to publish" >&2; exit 1; } | ||
|
||
curl \ | ||
-s \ | ||
--connect-timeout 240 \ | ||
--max-time 2700 \ | ||
-u ${ARTIFACTORY_USERNAME}:${ARTIFACTORY_PASSWORD} \ | ||
-f \ | ||
-X PUT \ | ||
-T "target/repository/artifacts.jar" \ | ||
"https://repo.spring.io/javaformat-eclipse-update-site/" > /dev/null || { echo "Failed to publish" >&2; exit 1; } | ||
|
||
popd > /dev/null | ||
|
||
echo "Publish complete" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
name: 'Stage ' | ||
description: 'Stage Code' | ||
inputs: | ||
current-version: | ||
required: true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"files": [ | ||
{ | ||
"aql": { | ||
"items.find": { | ||
"$and": [ | ||
{ | ||
"@build.name": "${buildName}", | ||
"@build.number": "${buildNumber}", | ||
"name": { | ||
"$nmatch": "*.zip" | ||
}, | ||
"name": { | ||
"$nmatch": "*.zip.asc" | ||
} | ||
} | ||
] | ||
} | ||
}, | ||
"target": "nexus/" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,5 +33,52 @@ jobs: | |
name: Promote | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Promote | ||
run: echo "Promote happens here" | ||
- name: Check Out | ||
uses: actions/checkout@v4 | ||
- name: Set Up JFrog CLI | ||
uses: jfrog/setup-jfrog-cli@7c95feb32008765e1b4e626b078dfd897c4340ad # v4.1.2 | ||
env: | ||
JF_ENV_SPRING: ${{ secrets.JF_ARTIFACTORY_SPRING }} | ||
- name: Check Maven Central Sync Status | ||
id: check-sync-status | ||
run: | | ||
url=${{ format('https://repo.maven.apache.org/maven2/io/spring/javaformat/spring-javaformat/{0}/spring-javaformat-{0}.pom', inputs.version) }} | ||
status_code=$( curl --write-out '%{http_code}' --head --silent --output /dev/null ${url} ) | ||
if [ "${status_code}" != 200 ] && [ "${status_code}" != 404 ]; then | ||
echo "Unexpected status code ${status_code}" | ||
exit 1 | ||
fi | ||
echo "status-code=${status_code}" >> $GITHUB_OUTPUT | ||
- name: Download Release Artifacts | ||
if: ${{ steps.check-sync-status.outputs.status-code == '404' }} | ||
run: jf rt download --spec ./.github/artifacts.spec --spec-vars 'buildName=${{ format('spring-javaformat-{0}', inputs.version) }};buildNumber=${{ inputs.build-number }}' | ||
- name: Sync to Maven Central | ||
if: ${{ steps.check-sync-status.outputs.status-code == '404' }} | ||
uses: spring-io/[email protected] | ||
with: | ||
username: ${{ secrets.OSSRH_S01_TOKEN_USERNAME }} | ||
password: ${{ secrets.OSSRH_S01_TOKEN_PASSWORD }} | ||
staging-profile-name: ${{ secrets.OSSRH_S01_STAGING_PROFILE }} | ||
create: true | ||
upload: true | ||
close: true | ||
release: true | ||
generate-checksums: true | ||
- name: Await Maven Central Sync | ||
if: ${{ steps.check-sync-status.outputs.status-code == '404' }} | ||
run: | | ||
url=${{ format('https://repo.maven.apache.org/maven2/io/spring/javaformat/spring-javaformat/{0}/spring-javaformat-{0}.pom', inputs.version) }} | ||
echo "Waiting for $url" | ||
until curl --fail --head --silent $url > /dev/null | ||
do | ||
echo "." | ||
sleep 60 | ||
done | ||
echo "$url is available" | ||
- name: Publish Eclipse Update Site | ||
uses: ./.github/actions/publish-eclipse-update-site | ||
with: | ||
version: ${{ inputs.version }} | ||
build-number: ${{ inputs.build-number }} | ||
- name: Create GitHub Release | ||
run: echo "Create GitHub Release" |