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
64 changes: 21 additions & 43 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,57 +19,35 @@ env:
JAVA_VERSION: '17'

jobs:
verify-linux:
name: Verify (Linux)
validation-gate:
name: Require Validation
runs-on: ubuntu-latest
timeout-minutes: 45
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: ${{ env.JAVA_VERSION }}
- name: Install Kotlin/Native toolchain deps
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends -y build-essential libcurl4-openssl-dev libssl-dev zlib1g-dev
- name: Setup Gradle
uses: gradle/gradle-build-action@v3
- name: Ensure validation workflow succeeded
uses: actions/github-script@v7
with:
gradle-home-cache-cleanup: true
- name: Run checks
run: ./gradlew --stacktrace clean check
script: |
const { owner, repo } = context.repo
const workflowId = 'validation.yml'
const headSha = context.payload?.head_commit?.id ?? context.sha

verify-macos:
name: Verify (macOS)
runs-on: macos-latest
timeout-minutes: 45
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: ${{ env.JAVA_VERSION }}
- name: Setup Gradle
uses: gradle/gradle-build-action@v3
with:
gradle-home-cache-cleanup: true
- name: Build & test Apple targets
run: ./gradlew --stacktrace macosArm64Test
const runs = await github.paginate(
github.rest.actions.listWorkflowRunsForWorkflow,
{ owner, repo, workflow_id: workflowId, per_page: 100, status: 'success' }
)

const match = runs.find(run => run.head_sha === headSha)
if (!match) {
core.setFailed(`No successful "${workflowId}" run found for commit ${headSha}. Please run validation and retry.`)
} else {
core.info(`Validation succeeded in ${match.html_url}`)
}

publish:
name: Publish
needs:
- verify-linux
- verify-macos
- validation-gate
runs-on: ubuntu-latest
timeout-minutes: 60
environment:
Expand Down
2 changes: 1 addition & 1 deletion docs/ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ GRADLE_USER_HOME=.gradle ./gradlew checkLegacyAbi

## Release (`.github/workflows/release.yml`)
- Triggered on annotated tags matching `v*` or manually.
- Runs the same Linux (`clean check`) and macOS (`macosArm64Test`) gates before any publishing.
- Verifies that the latest `validation.yml` run succeeded for the tagged commit before publishing anything.
- Publishes artifacts to both GitHub Packages and Maven Central, then closes/releases the Sonatype staging repository.
- Generates release notes via `git-cliff` using `git-cliff.toml` and posts them to the GitHub Release.

Expand Down
Loading