Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 85 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Release

on:
workflow_dispatch:
inputs:
release-version:
description: 'Version to release, e.g. 5.19.0.RELEASE'
type: string
required: true
snapshot-version:
description: 'Next development version, e.g. 5.20.0.BUILD-SNAPSHOT'
type: string
required: true
dry-run:
description: 'Upload to the Central Portal for validation only: nothing is published or pushed'
type: boolean
default: true

permissions:
contents: write

concurrency:
group: release
cancel-in-progress: false

jobs:
release:
# Only 5.x.x for now: main builds with Java 17 and still uses artifactory-maven-plugin.
if: ${{ github.repository == 'cloudfoundry/cf-java-client' && github.ref == 'refs/heads/5.x.x' }}
runs-on: ubuntu-latest
timeout-minutes: 60
env:
RELEASE_BRANCH: ${{ github.ref_name }}
RELEASE_VERSION: ${{ inputs.release-version }}
SNAPSHOT_VERSION: ${{ inputs.snapshot-version }}
DRY_RUN: ${{ inputs.dry-run }}
steps:
- uses: actions/checkout@v7
with:
submodules: recursive
- name: Set up Java
uses: actions/setup-java@v6
with:
distribution: liberica
java-version: 8
cache: maven
server-id: central
server-username: CENTRAL_USERNAME
server-password: CENTRAL_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Configure git
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
# Leaves HEAD on the snapshot commit and the v<release> tag on the release commit.
- name: Create release and snapshot commits
run: ci/create-release.sh "$RELEASE_VERSION" "$SNAPSHOT_VERSION"
# A published release can't be taken back on Maven Central, so the tag goes out first.
# If the deploy fails, delete the tag with: git push origin :refs/tags/v<release>
- name: Push tag
if: ${{ !inputs.dry-run }}
run: git push origin "v$RELEASE_VERSION"
- name: Deploy to Maven Central
env:
CENTRAL_USERNAME: ${{ secrets.CENTRAL_USERNAME }}
CENTRAL_PASSWORD: ${{ secrets.CENTRAL_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
run: |
publish_args=()
if [ "$DRY_RUN" = "true" ]; then
# Uploads and validates the bundle; drop it in the Central Portal afterwards.
publish_args=(-Dcentral-publishing.autoPublish=false -Dcentral-publishing.waitUntil=validated)
fi
git checkout --quiet "v$RELEASE_VERSION"
./mvnw --batch-mode -Dmaven.test.skip=true "${publish_args[@]}" deploy
git checkout --quiet -
- name: Push development version
if: ${{ !inputs.dry-run }}
run: git push origin "HEAD:$RELEASE_BRANCH"
- name: Create GitHub release
if: ${{ !inputs.dry-run }}
env:
GH_TOKEN: ${{ github.token }}
run: gh release create "v$RELEASE_VERSION" --title "v$RELEASE_VERSION" --generate-notes
18 changes: 0 additions & 18 deletions ci/Dockerfile

This file was deleted.

87 changes: 0 additions & 87 deletions ci/claim-environment.sh

This file was deleted.

31 changes: 0 additions & 31 deletions ci/deploy.sh

This file was deleted.

38 changes: 0 additions & 38 deletions ci/integration-test.sh

This file was deleted.

9 changes: 0 additions & 9 deletions ci/promote-to-maven-central.sh

This file was deleted.

27 changes: 0 additions & 27 deletions ci/tcp-routes.yml

This file was deleted.

17 changes: 0 additions & 17 deletions ci/unclaim-environment.sh

This file was deleted.

8 changes: 0 additions & 8 deletions ci/unit-test.sh

This file was deleted.

34 changes: 12 additions & 22 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@

<dependencies.version>2.7.18</dependencies.version>

<!-- The release workflow's dry run sets autoPublish=false and waitUntil=validated -->
<central-publishing.autoPublish>true</central-publishing.autoPublish>
<central-publishing.waitUntil>published</central-publishing.waitUntil>
<commons-compress.version>1.28.0</commons-compress.version>
<commons-lang3.version>3.22.0</commons-lang3.version>
<evo-inflector.version>1.3</evo-inflector.version>
Expand Down Expand Up @@ -240,28 +243,15 @@

<plugins>
<plugin>
<groupId>org.jfrog.buildinfo</groupId>
<artifactId>artifactory-maven-plugin</artifactId>
<version>3.7.1</version>
<inherited>false</inherited>
<executions>
<execution>
<id>build-info</id>
<goals>
<goal>publish</goal>
</goals>
<configuration>
<publisher>
<contextUrl>https://repo.spring.io</contextUrl>
<username>{{ARTIFACTORY_USERNAME}}</username>
<password>{{ARTIFACTORY_PASSWORD}}</password>
<repoKey>{{ARTIFACTORY_REPO_KEY|"libs-release-local"}}</repoKey>
<snapshotRepoKey>{{ARTIFACTORY_SNAPSHOT_REPO_KEY|"libs-snapshot-local"}}</snapshotRepoKey>
<excludePatterns>*-tests.jar</excludePatterns>
</publisher>
</configuration>
</execution>
</executions>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>0.8.0</version>
<extensions>true</extensions>
<configuration>
<publishingServerId>central</publishingServerId>
<autoPublish>${central-publishing.autoPublish}</autoPublish>
<waitUntil>${central-publishing.waitUntil}</waitUntil>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down