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
2 changes: 1 addition & 1 deletion .github/scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ candidate() {
write_output prerelease "$([[ "$version" == *-RC* ]] && echo true || echo false)"
}

# Tests the project and verifies its primary local Maven publication.
# Builds the project without running tests and verifies its primary local Maven publication.
build_maven() {
require RELEASE_COMMIT
require RELEASE_VERSION
Expand Down
15 changes: 12 additions & 3 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,26 @@

## Releases

[`release.yml`](release.yml) publishes a release from an exact commit after a
release pull request is merged. Normal releases require two human decisions:
[`release-validation.yml`](release-validation.yml) validates changelog changes
on pull requests. It has no release build or publication jobs.

[`release.yml`](release.yml) builds and publishes releases after a release pull
request is merged, or when started manually. It does not run on pull requests.
Normal releases require two human decisions:

1. Review and merge a pull request that promotes the desired entries from the
`CHANGELOG.md` `[Unreleased]` section into one new
`## [X.Y.Z] - YYYY-MM-DD` section.
2. Approve the `release-publication` GitHub environment after the workflow has
tested the Maven publications and built the native test server executables.
verified the local Maven artifacts and built the native test server executables.
Approval must be given within 30 days or GitHub automatically fails the
waiting job.

The **Build and verify local Maven artifacts** job builds artifacts in a temporary
Maven repository on the runner and verifies the generated POM. It does not run
SDK tests or publish to Maven Central. SDK tests remain in the normal
Continuous Integration workflow.

The protected `publish` job depends on both validation paths, so GitHub does
not request approval until they succeed. GitHub marks the job as **Waiting**
and sends the configured required reviewers a deployment review notification;
Expand Down
49 changes: 49 additions & 0 deletions .github/workflows/release-validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Release validation

defaults:
run:
shell: bash -euo pipefail {0}

on:
pull_request:
branches: [main, "releases/**", "v*.*.x", "*.*.x", "release_*_*_x"]
paths:
- CHANGELOG.md
- .github/scripts/release.sh
- .github/workflows/release-validation.yml
- .github/workflows/release.yml

permissions:
contents: read

jobs:
candidate:
name: Resolve release candidate
runs-on: ubuntu-latest
steps:
- name: Checkout candidate
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}

- name: Validate changelog transition
id: metadata
env:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
EVENT_NAME: ${{ github.event_name }}
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
run: .github/scripts/release.sh candidate "$RUNNER_TEMP/release-notes.md"

- name: Summarize candidate
if: steps.metadata.outputs.release == 'true'
env:
RELEASE_COMMIT: ${{ steps.metadata.outputs.commit }}
RELEASE_TAG: ${{ steps.metadata.outputs.tag }}
run: |
{
echo "## Release candidate"
echo
echo "- Tag: \`$RELEASE_TAG\`"
echo "- Commit: \`$RELEASE_COMMIT\`"
} >> "$GITHUB_STEP_SUMMARY"
33 changes: 10 additions & 23 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ defaults:
shell: bash -euo pipefail {0}

on:
pull_request:
branches: [main, "releases/**", "v*.*.x", "*.*.x", "release_*_*_x"]
paths: [CHANGELOG.md]
push:
branches: [main, "releases/**", "v*.*.x", "*.*.x", "release_*_*_x"]
paths: [CHANGELOG.md]
Expand Down Expand Up @@ -42,23 +39,21 @@ jobs:
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
ref: ${{ github.sha }}

- name: Validate changelog transition
id: metadata
env:
BASE_SHA: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before }}
BASE_SHA: ${{ github.event.before }}
EVENT_NAME: ${{ github.event_name }}
HEAD_SHA: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
HEAD_SHA: ${{ github.sha }}
MANUAL_DRAFT_RELEASE: ${{ inputs.draft_release }}
MANUAL_REF: ${{ github.ref_name }}
MANUAL_VERSION: ${{ inputs.version }}
run: .github/scripts/release.sh candidate "$RUNNER_TEMP/release-notes.md"

- name: Upload exact release notes
if: >-
(github.event_name == 'push' || github.event_name == 'workflow_dispatch') &&
steps.metadata.outputs.release == 'true'
if: steps.metadata.outputs.release == 'true'
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7
with:
name: release-notes-${{ steps.metadata.outputs.commit }}
Expand All @@ -81,10 +76,8 @@ jobs:
} >> "$GITHUB_STEP_SUMMARY"

build_maven:
name: Test and inspect Maven publications
if: >-
(github.event_name == 'push' || github.event_name == 'workflow_dispatch') &&
needs.candidate.outputs.release == 'true'
name: Build and verify local Maven artifacts
if: needs.candidate.outputs.release == 'true'
needs: candidate
runs-on: ubuntu-latest
timeout-minutes: 90
Expand All @@ -105,7 +98,7 @@ jobs:
- name: Set up Gradle
uses: gradle/actions/setup-gradle@ac396bf1a80af16236baf54bd7330ae21dc6ece5 # v6

- name: Test and inspect Maven publications
- name: Build and verify local Maven artifacts
env:
RELEASE_COMMIT: ${{ needs.candidate.outputs.commit }}
RELEASE_VERSION: ${{ needs.candidate.outputs.version }}
Expand All @@ -115,9 +108,7 @@ jobs:

build_native:
name: Build native test server
if: >-
(github.event_name == 'push' || github.event_name == 'workflow_dispatch') &&
needs.candidate.outputs.release == 'true'
if: needs.candidate.outputs.release == 'true'
needs: candidate
uses: ./.github/workflows/build-native-image.yml
with:
Expand All @@ -127,9 +118,7 @@ jobs:

package_native:
name: Package native release assets
if: >-
(github.event_name == 'push' || github.event_name == 'workflow_dispatch') &&
needs.candidate.outputs.release == 'true'
if: needs.candidate.outputs.release == 'true'
needs: [candidate, build_native]
runs-on: ubuntu-latest
permissions:
Expand Down Expand Up @@ -164,9 +153,7 @@ jobs:

publish:
name: Publish ${{ needs.candidate.outputs.tag }}
if: >-
(github.event_name == 'push' || github.event_name == 'workflow_dispatch') &&
needs.candidate.outputs.release == 'true'
if: needs.candidate.outputs.release == 'true'
needs: [candidate, build_maven, package_native]
runs-on: ubuntu-latest
timeout-minutes: 150
Expand Down
Loading