From cf75d2f62d96b4477e6a5117b46e6cf88606d943 Mon Sep 17 00:00:00 2001 From: Pierre Millot Date: Wed, 10 Jul 2024 09:52:56 +0200 Subject: [PATCH 1/3] chore(ci): run mac ci in parralel --- .github/workflows/check.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index fe22b1813e..21ae5de0e7 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -349,6 +349,7 @@ jobs: - client_gen if: | always() && + needs.setup.outputs.RUN_GEN == 'true' && needs.setup.outputs.RUN_MACOS_KOTLIN_BUILD == 'true' && !contains(needs.*.result, 'cancelled') && !contains(needs.*.result, 'failure') @@ -378,7 +379,6 @@ jobs: - client_gen if: | always() && - startsWith(github.head_ref, 'chore/prepare-release-') && needs.setup.outputs.RUN_GEN == 'true' && needs.setup.outputs.RUN_MACOS_SWIFT_CTS == 'true' && !contains(needs.*.result, 'cancelled') && @@ -412,8 +412,6 @@ jobs: - setup - client_gen - client_gen_javascript - - swift_cts_macos - - kotlin_build_macos if: | always() && !contains(needs.*.result, 'cancelled') && @@ -523,6 +521,8 @@ jobs: timeout-minutes: 10 needs: - codegen + - swift_cts_macos + - kotlin_build_macos if: always() steps: - run: | From d8088d7dfed787e51afcb2d03cea3f2e69dfc084 Mon Sep 17 00:00:00 2001 From: Pierre Millot Date: Wed, 10 Jul 2024 11:35:41 +0200 Subject: [PATCH 2/3] split release --- .github/workflows/check.yml | 59 +++++++++++++++++++++++++------------ 1 file changed, 40 insertions(+), 19 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 21ae5de0e7..a861309976 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -379,6 +379,7 @@ jobs: - client_gen if: | always() && + startsWith(github.head_ref, 'chore/prepare-release-') && needs.setup.outputs.RUN_GEN == 'true' && needs.setup.outputs.RUN_MACOS_SWIFT_CTS == 'true' && !contains(needs.*.result, 'cancelled') && @@ -420,6 +421,7 @@ jobs: pull-requests: write outputs: success: ${{ steps.setoutput.outputs.success }} + generatedCommit: ${{ steps.pushGeneratedCode.outputs.GENERATED_COMMIT || github.event.pull_request.head.ref }} steps: - uses: actions/checkout@v4 with: @@ -493,25 +495,6 @@ jobs: | 🍃 Generated commit | [`${{ steps.pushGeneratedCode.outputs.GENERATED_COMMIT }}`](${{ github.event.pull_request.base.repo.html_url }}/commit/${{ steps.pushGeneratedCode.outputs.GENERATED_COMMIT }}) | | 🌲 Generated branch | [`generated/${{ github.head_ref }}`](${{ github.event.pull_request.base.repo.html_url }}/tree/generated/${{ github.head_ref }}) | - - name: Spread generation to each repository - id: spreadGeneration - if: github.ref == 'refs/heads/main' - run: yarn workspace scripts spreadGeneration - env: - GITHUB_TOKEN: ${{ secrets.ALGOLIA_BOT_TOKEN }} - - - name: Wait for all release CI - if: github.ref == 'refs/heads/main' - run: yarn workspace scripts waitForAllReleases ${{ steps.spreadGeneration.outputs.PUSHED_LANGUAGES }} - env: - GITHUB_TOKEN: ${{ secrets.ALGOLIA_BOT_TOKEN }} - - - name: Push specs to algolia documentation - if: github.ref == 'refs/heads/main' - run: yarn workspace scripts pushToAlgoliaDoc - env: - GITHUB_TOKEN: ${{ secrets.ALGOLIA_BOT_TOKEN }} - - name: Set output id: setoutput run: echo "success=true" >> "$GITHUB_OUTPUT" @@ -530,3 +513,41 @@ jobs: echo "codegen step didn't succeed" exit 1 fi + + push_and_release: + runs-on: ubuntu-22.04 + timeout-minutes: 15 + needs: + - codegen + - check_green + if: github.ref == 'refs/heads/main' + permissions: + pull-requests: write + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: ${{ needs.codegen.outputs.generatedCommit }} + token: ${{ secrets.ALGOLIA_BOT_TOKEN }} + repository: ${{ github.event.pull_request.head.repo.full_name }} + + - name: Setup + uses: ./.github/actions/setup + with: + type: minimal + + - name: Spread generation to each repository + id: spreadGeneration + run: yarn workspace scripts spreadGeneration + env: + GITHUB_TOKEN: ${{ secrets.ALGOLIA_BOT_TOKEN }} + + - name: Wait for all release CI + run: yarn workspace scripts waitForAllReleases ${{ steps.spreadGeneration.outputs.PUSHED_LANGUAGES }} + env: + GITHUB_TOKEN: ${{ secrets.ALGOLIA_BOT_TOKEN }} + + - name: Push specs to algolia documentation + run: yarn workspace scripts pushToAlgoliaDoc + env: + GITHUB_TOKEN: ${{ secrets.ALGOLIA_BOT_TOKEN }} From 6344ad17cf634f0a765b1b8b45ccd6f2e92d6062 Mon Sep 17 00:00:00 2001 From: Pierre Millot Date: Wed, 10 Jul 2024 11:52:38 +0200 Subject: [PATCH 3/3] log --- scripts/ci/codegen/waitForAllReleases.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/ci/codegen/waitForAllReleases.ts b/scripts/ci/codegen/waitForAllReleases.ts index 6a93b5ee6b..a31f5564c5 100644 --- a/scripts/ci/codegen/waitForAllReleases.ts +++ b/scripts/ci/codegen/waitForAllReleases.ts @@ -51,6 +51,8 @@ async function waitForAllReleases(languagesReleased: Language[]): Promise const lastCommitMessage = await run('git log -1 --format="%s"'); if (!lastCommitMessage.startsWith(commitStartRelease)) { + console.log('No release commit found, skipping waiting for CI'); + return; }