From 7c2b1c821fff36cd1b7b27d2bd46b1de7620c6f0 Mon Sep 17 00:00:00 2001 From: Danielku15 Date: Sat, 17 Oct 2026 14:02:41 +0200 Subject: [PATCH] ci: run publish only when the nightly check finds changes The scheduled Publish run ended green on days without changes, because skipped build jobs count as success. Real publish failures were easy to miss between those runs. A new scheduled Nightly workflow runs the change check for all platforms and dispatches Publish only for the platforms that changed. Publish is now workflow_dispatch only, with per-platform and force inputs, so every Publish run is a real publish attempt. The reusable publish workflows no longer contain their own check jobs. --- .github/workflows/nightly.yml | 39 +++++++++++++++++++++++++++ .github/workflows/publish.yml | 39 +++++++++++++++++++-------- .github/workflows/~publish_dotnet.yml | 17 ------------ .github/workflows/~publish_kotlin.yml | 17 ------------ .github/workflows/~publish_web.yml | 17 ------------ 5 files changed, 67 insertions(+), 62 deletions(-) create mode 100644 .github/workflows/nightly.yml diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml new file mode 100644 index 000000000..308d35ac0 --- /dev/null +++ b/.github/workflows/nightly.yml @@ -0,0 +1,39 @@ +name: Nightly + +on: + schedule: + - cron: "10 0 * * *" + workflow_dispatch: + +permissions: + contents: read + actions: write + +jobs: + check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + with: + fetch-depth: 100 + - uses: actions/setup-node@v7 + with: + node-version: 'lts/*' + + - run: npm run nightly-check -- --platform web --force false + id: web + - run: npm run nightly-check -- --platform dotnet --force false + id: dotnet + - run: npm run nightly-check -- --platform kotlin --force false + id: kotlin + + # Runs dispatched via GITHUB_TOKEN are an exception to the no-recursive-runs rule, so no PAT is needed. + - if: steps.web.outputs.has_changes == 'true' || steps.dotnet.outputs.has_changes == 'true' || steps.kotlin.outputs.has_changes == 'true' + run: > + gh workflow run publish.yml + --ref ${{ github.ref_name }} + -f web=${{ steps.web.outputs.has_changes }} + -f dotnet=${{ steps.dotnet.outputs.has_changes }} + -f kotlin=${{ steps.kotlin.outputs.has_changes }} + env: + GH_TOKEN: ${{ github.token }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 80fd9f99b..a53f3f227 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,10 +1,24 @@ name: Publish on: - schedule: - - cron: "10 0 * * *" workflow_dispatch: inputs: + web: + type: boolean + description: Publish web packages + default: true + dotnet: + type: boolean + description: Publish .NET packages + default: true + kotlin: + type: boolean + description: Publish Kotlin packages + default: true + force: + type: boolean + description: Publish all web packages, not only the ones changed in the last 26 hours + default: false dry_run: type: boolean description: Build and verify all packages without publishing them @@ -12,29 +26,32 @@ on: jobs: web: + if: inputs.web uses: ./.github/workflows/~publish_web.yml permissions: contents: read id-token: write secrets: inherit - with: + with: version: alpha ${{github.run_number}} npm_tag: alpha - force: ${{ inputs.dry_run == true }} - dry_run: ${{ inputs.dry_run == true }} + force: ${{ inputs.force || inputs.dry_run }} + dry_run: ${{ inputs.dry_run }} dotnet: + if: inputs.dotnet uses: ./.github/workflows/~publish_dotnet.yml secrets: inherit - with: + with: version: alpha ${{github.run_number}} - force: ${{ inputs.dry_run == true }} - dry_run: ${{ inputs.dry_run == true }} + force: ${{ inputs.force || inputs.dry_run }} + dry_run: ${{ inputs.dry_run }} kotlin: + if: inputs.kotlin uses: ./.github/workflows/~publish_kotlin.yml secrets: inherit - with: + with: version: alpha ${{github.run_number}} - force: ${{ inputs.dry_run == true }} - dry_run: ${{ inputs.dry_run == true }} \ No newline at end of file + force: ${{ inputs.force || inputs.dry_run }} + dry_run: ${{ inputs.dry_run }} diff --git a/.github/workflows/~publish_dotnet.yml b/.github/workflows/~publish_dotnet.yml index 59f69d64f..00b85a51d 100644 --- a/.github/workflows/~publish_dotnet.yml +++ b/.github/workflows/~publish_dotnet.yml @@ -12,24 +12,7 @@ on: default: false jobs: - check: - runs-on: ubuntu-latest - outputs: - has_changes: ${{ steps.check.outputs.has_changes }} - steps: - - uses: actions/checkout@v7 - with: - fetch-depth: 100 - - uses: actions/setup-node@v7 - with: - node-version: 'lts/*' - cache: 'npm' - - run: npm run nightly-check -- --platform dotnet --force ${{ inputs.force }} - id: check - build: - needs: check - if: needs.check.outputs.has_changes == 'true' runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 diff --git a/.github/workflows/~publish_kotlin.yml b/.github/workflows/~publish_kotlin.yml index b3ed784e9..bc8e92812 100644 --- a/.github/workflows/~publish_kotlin.yml +++ b/.github/workflows/~publish_kotlin.yml @@ -12,24 +12,7 @@ on: default: false jobs: - check: - runs-on: ubuntu-latest - outputs: - has_changes: ${{ steps.check.outputs.has_changes }} - steps: - - uses: actions/checkout@v7 - with: - fetch-depth: 100 - - uses: actions/setup-node@v7 - with: - node-version: 'lts/*' - cache: 'npm' - - run: npm run nightly-check -- --platform kotlin --force ${{ inputs.force }} - id: check - build: - needs: check - if: needs.check.outputs.has_changes == 'true' runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 diff --git a/.github/workflows/~publish_web.yml b/.github/workflows/~publish_web.yml index c52fc40b7..084937332 100644 --- a/.github/workflows/~publish_web.yml +++ b/.github/workflows/~publish_web.yml @@ -19,24 +19,7 @@ on: jobs: - check: - runs-on: ubuntu-latest - outputs: - has_changes: ${{ steps.check.outputs.has_changes }} - steps: - - uses: actions/checkout@v7 - with: - fetch-depth: 100 - - uses: actions/setup-node@v7 - with: - node-version: 'lts/*' - cache: 'npm' - - run: npm run nightly-check -- --platform web --force ${{ inputs.force }} - id: check - build: - needs: check - if: needs.check.outputs.has_changes == 'true' runs-on: ubuntu-latest permissions: contents: read