diff --git a/doc/changes/unreleased.md b/doc/changes/unreleased.md index dfad76d7d..8292212a9 100644 --- a/doc/changes/unreleased.md +++ b/doc/changes/unreleased.md @@ -4,4 +4,5 @@ ## Bug +* #909: Updated `cd.yml` workflow so that `cd-extension.yml` workflow depends on `build-and-publish`. This ensures that the custom release workflow only runs when the PyPi release was successful. * #910: Add `gh-pages.yml` to be ignored when `has_documentation=False` in the `PROJECT_CONFIG` diff --git a/doc/user_guide/features/github_workflows/index.rst b/doc/user_guide/features/github_workflows/index.rst index 9b3e85b9b..0247b7547 100644 --- a/doc/user_guide/features/github_workflows/index.rst +++ b/doc/user_guide/features/github_workflows/index.rst @@ -171,6 +171,7 @@ and is maintained by the PTB and what is project-specific. * - ``cd-extension.yml`` - Workflow call - This extends the ``cd.yml``. Use it to add project-specific release steps. + Runs after ``build-and-publish.yml`` workflow has finished successfully. * - ``merge-gate-extension.yml`` - Workflow call - This extends the ``merge-gate.yml`` and the ``needs`` criteria of the job @@ -287,6 +288,7 @@ to main. This starts the release process by activating the ``cd.yml`` workflow. %% Dependencies / Waiting (Dotted Lines) check-release-tag -.->|needs| build-and-publish[build-and-publish.yml] + build-and-publish -.->|needs| cd-extension[cd-extension.yml] build-and-publish -.->|needs| gh-pages[gh-pages.yml] .. _automated_activities: diff --git a/exasol/toolbox/templates/github/workflows/cd.yml b/exasol/toolbox/templates/github/workflows/cd.yml index 55fd7ae91..13ab7bf98 100644 --- a/exasol/toolbox/templates/github/workflows/cd.yml +++ b/exasol/toolbox/templates/github/workflows/cd.yml @@ -29,7 +29,7 @@ jobs: name: Extension uses: ./.github/workflows/cd-extension.yml needs: - - check-release-tag + - build-and-publish (% if custom_workflows["cd-extension"].secrets %) secrets: (% for secret_name in custom_workflows["cd-extension"].secrets %) @@ -50,4 +50,4 @@ jobs: contents: read pages: write id-token: write - (% endif %) \ No newline at end of file + (% endif %) diff --git a/exasol/toolbox/util/workflows/process_template.py b/exasol/toolbox/util/workflows/process_template.py index 44257b1f1..2939fccbb 100644 --- a/exasol/toolbox/util/workflows/process_template.py +++ b/exasol/toolbox/util/workflows/process_template.py @@ -118,7 +118,7 @@ def _remove_job_from_needs(self, job_name: str) -> None: needs_without_removed_job = [need for need in needs if need != job_name] if len(needs_without_removed_job) == 0: other_job.pop("needs") - return + continue other_job["needs"] = needs_without_removed_job def _verify_job_exists(self, job_name: str) -> None: