diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 991059ec..4c43a032 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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: diff --git a/docs/ci.md b/docs/ci.md index c6a22976..3d24b942 100644 --- a/docs/ci.md +++ b/docs/ci.md @@ -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.