From 93d1b552a975bede2675a4bac1838e89b6c8f1c2 Mon Sep 17 00:00:00 2001 From: Daniel Fernandes Date: Thu, 10 Apr 2025 13:33:49 +0000 Subject: [PATCH 01/49] Make pypi, release depend on test --- .../workflows/ci.yml.jinja" | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git "a/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" "b/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" index c6ed106f..98d9d938 100644 --- "a/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" +++ "b/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" @@ -54,14 +54,14 @@ jobs: {% if pypi %} pypi: if: github.ref_type == 'tag' - needs: dist + needs: [dist, test] uses: ./.github/workflows/_pypi.yml permissions: id-token: write {% endif %} release: if: github.ref_type == 'tag' - needs: [dist{% if sphinx %}, docs{% endif %}] + needs: [dist, test{% if sphinx %}, docs{% endif %}] uses: ./.github/workflows/_release.yml permissions: contents: write From b7f2a2c30bbc839bfffb44da499002698d20e696 Mon Sep 17 00:00:00 2001 From: Daniel Fernandes Date: Thu, 10 Apr 2025 14:09:05 +0000 Subject: [PATCH 02/49] Split container build and push into two jobs --- .github/workflows/_container.yml | 26 +++----------- ...f docker %}_push_container.yml{% endif %}" | 35 +++++++++++++++++++ 2 files changed, 40 insertions(+), 21 deletions(-) create mode 100644 "template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/{% if docker %}_push_container.yml{% endif %}" diff --git a/.github/workflows/_container.yml b/.github/workflows/_container.yml index da5e4936..bec61a29 100644 --- a/.github/workflows/_container.yml +++ b/.github/workflows/_container.yml @@ -36,25 +36,9 @@ jobs: - name: Test cli works in cached runtime image run: docker run --rm tag_for_testing --version - - - name: Create tags for publishing image - id: meta - uses: docker/metadata-action@v5 + + - name: Upload container as artifact + uses: actions/upload-artifact@v4 with: - images: ghcr.io/${{ github.repository }} - tags: | - type=ref,event=tag - type=raw,value=latest - - - name: Push cached image to container registry - if: github.ref_type == 'tag' - uses: docker/build-push-action@v6 - env: - DOCKER_BUILD_RECORD_UPLOAD: false - # This does not build the image again, it will find the image in the - # Docker cache and publish it - with: - context: . - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} + name: container + path: container diff --git "a/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/{% if docker %}_push_container.yml{% endif %}" "b/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/{% if docker %}_push_container.yml{% endif %}" new file mode 100644 index 00000000..49900927 --- /dev/null +++ "b/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/{% if docker %}_push_container.yml{% endif %}" @@ -0,0 +1,35 @@ +on: + workflow_call: + +jobs: + push: + runs-on: ubuntu-latest + + steps: + - name: Download container artifact + uses: actions/download-artifact@v4 + with: + name: container + path: container + + - name: Create tags for publishing image + id: meta + uses: docker/metadata-action@v5 + with: + images: ghcr.io/${{ github.repository }} + tags: | + type=ref,event=tag + type=raw,value=latest + + - name: Push cached image to container registry + if: github.ref_type == 'tag' + uses: docker/build-push-action@v6 + env: + DOCKER_BUILD_RECORD_UPLOAD: false + # This does not build the image again, it will find the image in the + # Docker cache and publish it + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} From 55901ed58fca2f79b8ec0e3300133afed0a55604 Mon Sep 17 00:00:00 2001 From: Daniel Fernandes Date: Thu, 10 Apr 2025 14:13:04 +0000 Subject: [PATCH 03/49] Add call to _push_container.yml in ci.yml.jinja --- .../workflows/ci.yml.jinja" | 7 +++++++ 1 file changed, 7 insertions(+) diff --git "a/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" "b/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" index 98d9d938..a759b8bd 100644 --- "a/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" +++ "b/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" @@ -41,6 +41,13 @@ jobs: permissions: contents: read packages: write + + push container: + needs: [container, test] + uses: ./github/workflows/_push_container.yml + permissions: + contents: read + packages: write {% endif %}{% if sphinx %} docs: needs: check From fcdb8b26c79800c8a7fc79891a0376cbd1679786 Mon Sep 17 00:00:00 2001 From: Daniel Fernandes Date: Fri, 11 Apr 2025 14:51:20 +0100 Subject: [PATCH 04/49] Move _push_container.yml out of template, add symlink to new location --- .github/workflows/_push_container.yml | 35 ++++++++++++++++++ ...f docker %}_push_container.yml{% endif %}" | 36 +------------------ 2 files changed, 36 insertions(+), 35 deletions(-) create mode 100644 .github/workflows/_push_container.yml mode change 100644 => 120000 "template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/{% if docker %}_push_container.yml{% endif %}" diff --git a/.github/workflows/_push_container.yml b/.github/workflows/_push_container.yml new file mode 100644 index 00000000..49900927 --- /dev/null +++ b/.github/workflows/_push_container.yml @@ -0,0 +1,35 @@ +on: + workflow_call: + +jobs: + push: + runs-on: ubuntu-latest + + steps: + - name: Download container artifact + uses: actions/download-artifact@v4 + with: + name: container + path: container + + - name: Create tags for publishing image + id: meta + uses: docker/metadata-action@v5 + with: + images: ghcr.io/${{ github.repository }} + tags: | + type=ref,event=tag + type=raw,value=latest + + - name: Push cached image to container registry + if: github.ref_type == 'tag' + uses: docker/build-push-action@v6 + env: + DOCKER_BUILD_RECORD_UPLOAD: false + # This does not build the image again, it will find the image in the + # Docker cache and publish it + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git "a/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/{% if docker %}_push_container.yml{% endif %}" "b/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/{% if docker %}_push_container.yml{% endif %}" deleted file mode 100644 index 49900927..00000000 --- "a/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/{% if docker %}_push_container.yml{% endif %}" +++ /dev/null @@ -1,35 +0,0 @@ -on: - workflow_call: - -jobs: - push: - runs-on: ubuntu-latest - - steps: - - name: Download container artifact - uses: actions/download-artifact@v4 - with: - name: container - path: container - - - name: Create tags for publishing image - id: meta - uses: docker/metadata-action@v5 - with: - images: ghcr.io/${{ github.repository }} - tags: | - type=ref,event=tag - type=raw,value=latest - - - name: Push cached image to container registry - if: github.ref_type == 'tag' - uses: docker/build-push-action@v6 - env: - DOCKER_BUILD_RECORD_UPLOAD: false - # This does not build the image again, it will find the image in the - # Docker cache and publish it - with: - context: . - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} diff --git "a/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/{% if docker %}_push_container.yml{% endif %}" "b/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/{% if docker %}_push_container.yml{% endif %}" new file mode 120000 index 00000000..daeafe96 --- /dev/null +++ "b/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/{% if docker %}_push_container.yml{% endif %}" @@ -0,0 +1 @@ +../../../.github/workflows/_push_container.yml \ No newline at end of file From 39adf2c6c5ee8d8e9b18d6538cd1a40882442a4c Mon Sep 17 00:00:00 2001 From: Daniel Fernandes Date: Fri, 11 Apr 2025 15:34:00 +0100 Subject: [PATCH 05/49] Fix key name, fix file path --- .../workflows/ci.yml.jinja" | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git "a/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" "b/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" index a759b8bd..af7719d8 100644 --- "a/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" +++ "b/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" @@ -42,9 +42,9 @@ jobs: contents: read packages: write - push container: + push_container: needs: [container, test] - uses: ./github/workflows/_push_container.yml + uses: ./.github/workflows/_push_container.yml permissions: contents: read packages: write From 7cdac25faf4acade8e2e4fde375f068166124f94 Mon Sep 17 00:00:00 2001 From: Daniel Fernandes Date: Fri, 11 Apr 2025 15:49:48 +0100 Subject: [PATCH 06/49] Add ref_type=tag condition to push container --- .../workflows/ci.yml.jinja" | 1 + 1 file changed, 1 insertion(+) diff --git "a/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" "b/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" index af7719d8..3c095e2f 100644 --- "a/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" +++ "b/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" @@ -43,6 +43,7 @@ jobs: packages: write push_container: + if: github.ref_type == 'tag' needs: [container, test] uses: ./.github/workflows/_push_container.yml permissions: From 2cdd01823d254d74850d4f3be682131220ccf7d1 Mon Sep 17 00:00:00 2001 From: Daniel Fernandes Date: Fri, 11 Apr 2025 16:40:47 +0100 Subject: [PATCH 07/49] Seperate _docs into _push_docs, add symlink --- .github/workflows/_docs.yml | 19 ----------- .github/workflows/_push_docs.yml | 32 +++++++++++++++++++ .../{% if sphinx %}_push_docs.yml{% endif %}" | 1 + 3 files changed, 33 insertions(+), 19 deletions(-) create mode 100644 .github/workflows/_push_docs.yml create mode 120000 "template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/{% if sphinx %}_push_docs.yml{% endif %}" diff --git a/.github/workflows/_docs.yml b/.github/workflows/_docs.yml index a1cafcae..90485e64 100644 --- a/.github/workflows/_docs.yml +++ b/.github/workflows/_docs.yml @@ -33,22 +33,3 @@ jobs: with: name: docs path: build - - - name: Sanitize ref name for docs version - run: echo "DOCS_VERSION=${GITHUB_REF_NAME//[^A-Za-z0-9._-]/_}" >> $GITHUB_ENV - - - name: Move to versioned directory - run: mv build/html .github/pages/$DOCS_VERSION - - - name: Write switcher.json - run: python .github/pages/make_switcher.py --add $DOCS_VERSION ${{ github.repository }} .github/pages/switcher.json - - - name: Publish Docs to gh-pages - if: github.ref_type == 'tag' || github.ref_name == 'main' - # We pin to the SHA, not the tag, for security reasons. - # https://docs.github.com/en/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions - uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: .github/pages - keep_files: true diff --git a/.github/workflows/_push_docs.yml b/.github/workflows/_push_docs.yml new file mode 100644 index 00000000..00a715af --- /dev/null +++ b/.github/workflows/_push_docs.yml @@ -0,0 +1,32 @@ +on: + workflow_call: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Download built docs artifact + uses: actions/download-artifact@v4 + with: + name: docs + path: build + + - name: Sanitize ref name for docs version + run: echo "DOCS_VERSION=${GITHUB_REF_NAME//[^A-Za-z-1-9._-]/_}" >> $GITHUB_ENV + + - name: Move to versioned directory + run: mv build/html .github/pages/$DOCS_VERSION + + - name: Write switcher.json + run: python .github/pages/make_switcher.py --add $DOCS_VERSION ${{ github.repository }} .github/pages/switcher.json + + - name: Publish Docs to gh-pages + if: github.ref_type == 'tag' || github.ref_name == 'main' + # We pin to the SHA, not the tag, for security reasons. + # https://docs.github.com/en/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions + uses: peaceiris/actions-gh-pages@3f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: .github/pages + keep_files: true diff --git "a/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/{% if sphinx %}_push_docs.yml{% endif %}" "b/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/{% if sphinx %}_push_docs.yml{% endif %}" new file mode 120000 index 00000000..0c8d3868 --- /dev/null +++ "b/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/{% if sphinx %}_push_docs.yml{% endif %}" @@ -0,0 +1 @@ +../../../.github/workflows/_push_docs.yml \ No newline at end of file From f262aa59c4f1fdf9d41b8d38c2d0393a5a7233b1 Mon Sep 17 00:00:00 2001 From: Daniel Fernandes Date: Mon, 14 Apr 2025 13:08:30 +0000 Subject: [PATCH 08/49] Add repo checkout to _push_docs.yml --- .github/workflows/_push_docs.yml | 81 ++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) diff --git a/.github/workflows/_push_docs.yml b/.github/workflows/_push_docs.yml index 00a715af..f1c3cf72 100644 --- a/.github/workflows/_push_docs.yml +++ b/.github/workflows/_push_docs.yml @@ -6,6 +6,87 @@ jobs: runs-on: ubuntu-latest steps: + - name: Avoid git conflicts when tag and branch pushed at same time + if: github.ref_type == 'tag' + run: sleep 60 + + - name: Checkout + uses: actions/checkout@v4 + with: + # Need this to get version number from last tag + fetch-depth: 0 + + - name: Avoid git conflicts when tag and branch pushed at same time + if: github.ref_type == 'tag' + run: sleep 60 + + - name: Checkout + uses: actions/checkout@v4 + with: + # Need this to get version number from last tag + fetch-depth: 0 + + - name: Avoid git conflicts when tag and branch pushed at same time + if: github.ref_type == 'tag' + run: sleep 60 + + - name: Checkout + uses: actions/checkout@v4 + with: + # Need this to get version number from last tag + fetch-depth: 0 + + - name: Avoid git conflicts when tag and branch pushed at same time + if: github.ref_type == 'tag' + run: sleep 60 + + - name: Checkout + uses: actions/checkout@v4 + with: + # Need this to get version number from last tag + fetch-depth: 0 + + - name: Avoid git conflicts when tag and branch pushed at same time + if: github.ref_type == 'tag' + run: sleep 60 + + - name: Checkout + uses: actions/checkout@v4 + with: + # Need this to get version number from last tag + fetch-depth: 0 + + - name: Avoid git conflicts when tag and branch pushed at same time + if: github.ref_type == 'tag' + run: sleep 60 + + - name: Checkout + uses: actions/checkout@v4 + with: + # Need this to get version number from last tag + fetch-depth: 0 + + - name: Avoid git conflicts when tag and branch pushed at same time + if: github.ref_type == 'tag' + run: sleep 60 + + - name: Checkout + uses: actions/checkout@v4 + with: + # Need this to get version number from last tag + fetch-depth: 0 + + - name: Avoid git conflicts when tag and branch pushed at same time + if: github.ref_type == 'tag' + run: sleep 60 + + - name: Checkout + uses: actions/checkout@v4 + with: + # Need this to get version number from last tag + fetch-depth: 0 + + - name: Download built docs artifact uses: actions/download-artifact@v4 with: From 7a7a0a6b9f7623c84e6728ac71c0a457c2c167ea Mon Sep 17 00:00:00 2001 From: Daniel Fernandes Date: Tue, 15 Apr 2025 08:55:23 +0000 Subject: [PATCH 09/49] Remove duplicate code --- .github/workflows/_push_docs.yml | 71 -------------------------------- 1 file changed, 71 deletions(-) diff --git a/.github/workflows/_push_docs.yml b/.github/workflows/_push_docs.yml index f1c3cf72..02cc973f 100644 --- a/.github/workflows/_push_docs.yml +++ b/.github/workflows/_push_docs.yml @@ -16,77 +16,6 @@ jobs: # Need this to get version number from last tag fetch-depth: 0 - - name: Avoid git conflicts when tag and branch pushed at same time - if: github.ref_type == 'tag' - run: sleep 60 - - - name: Checkout - uses: actions/checkout@v4 - with: - # Need this to get version number from last tag - fetch-depth: 0 - - - name: Avoid git conflicts when tag and branch pushed at same time - if: github.ref_type == 'tag' - run: sleep 60 - - - name: Checkout - uses: actions/checkout@v4 - with: - # Need this to get version number from last tag - fetch-depth: 0 - - - name: Avoid git conflicts when tag and branch pushed at same time - if: github.ref_type == 'tag' - run: sleep 60 - - - name: Checkout - uses: actions/checkout@v4 - with: - # Need this to get version number from last tag - fetch-depth: 0 - - - name: Avoid git conflicts when tag and branch pushed at same time - if: github.ref_type == 'tag' - run: sleep 60 - - - name: Checkout - uses: actions/checkout@v4 - with: - # Need this to get version number from last tag - fetch-depth: 0 - - - name: Avoid git conflicts when tag and branch pushed at same time - if: github.ref_type == 'tag' - run: sleep 60 - - - name: Checkout - uses: actions/checkout@v4 - with: - # Need this to get version number from last tag - fetch-depth: 0 - - - name: Avoid git conflicts when tag and branch pushed at same time - if: github.ref_type == 'tag' - run: sleep 60 - - - name: Checkout - uses: actions/checkout@v4 - with: - # Need this to get version number from last tag - fetch-depth: 0 - - - name: Avoid git conflicts when tag and branch pushed at same time - if: github.ref_type == 'tag' - run: sleep 60 - - - name: Checkout - uses: actions/checkout@v4 - with: - # Need this to get version number from last tag - fetch-depth: 0 - - - name: Download built docs artifact uses: actions/download-artifact@v4 with: From 51ae06a045bd38a0a20d5091166240eb3d4509e4 Mon Sep 17 00:00:00 2001 From: Daniel Fernandes Date: Tue, 15 Apr 2025 08:58:39 +0000 Subject: [PATCH 10/49] Add _push_docs.yml to ci and tempalte ci --- .github/workflows/ci.yml | 6 ++++++ .../workflows/ci.yml.jinja" | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f198a244..966af2f7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,6 +32,12 @@ jobs: permissions: contents: write + push_docs: + needs: docs + uses: ./.github/workflows/_push_docs.yml + permissions: + contents: write + example: needs: test if: github.ref_name == 'main' diff --git "a/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" "b/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" index 3c095e2f..7bdd0532 100644 --- "a/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" +++ "b/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" @@ -54,6 +54,12 @@ jobs: needs: check if: needs.check.outputs.branch-pr == '' uses: ./.github/workflows/_docs.yml + + push_docs: + needs: docs + uses: ./.github/workflows/_push_docs.yml + permissions: + contents: write {% endif %} dist: needs: check From 9168714c5bd850e197ca6b1ea2562c27285c24b8 Mon Sep 17 00:00:00 2001 From: Daniel Fernandes Date: Tue, 15 Apr 2025 09:15:17 +0000 Subject: [PATCH 11/49] Remove uneccesary wait --- .github/workflows/_push_docs.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/_push_docs.yml b/.github/workflows/_push_docs.yml index 02cc973f..ed018814 100644 --- a/.github/workflows/_push_docs.yml +++ b/.github/workflows/_push_docs.yml @@ -6,10 +6,6 @@ jobs: runs-on: ubuntu-latest steps: - - name: Avoid git conflicts when tag and branch pushed at same time - if: github.ref_type == 'tag' - run: sleep 60 - - name: Checkout uses: actions/checkout@v4 with: From 78aa8bd8cf1dd9ad185cb43e7c5e328acb43a77b Mon Sep 17 00:00:00 2001 From: Daniel Fernandes Date: Tue, 15 Apr 2025 13:07:22 +0000 Subject: [PATCH 12/49] Fix referenced SHA --- .github/workflows/_push_docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/_push_docs.yml b/.github/workflows/_push_docs.yml index ed018814..790b28fa 100644 --- a/.github/workflows/_push_docs.yml +++ b/.github/workflows/_push_docs.yml @@ -31,7 +31,7 @@ jobs: if: github.ref_type == 'tag' || github.ref_name == 'main' # We pin to the SHA, not the tag, for security reasons. # https://docs.github.com/en/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions - uses: peaceiris/actions-gh-pages@3f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0 + uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: .github/pages From 307414efc21bd63b7d5090d49131ea344bafacf4 Mon Sep 17 00:00:00 2001 From: Daniel Fernandes Date: Wed, 16 Apr 2025 08:21:14 +0000 Subject: [PATCH 13/49] Have _push_docs call depend on test --- .github/workflows/ci.yml | 2 +- .../workflows/ci.yml.jinja" | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 966af2f7..10c0d01d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,7 +33,7 @@ jobs: contents: write push_docs: - needs: docs + needs: [test, docs] uses: ./.github/workflows/_push_docs.yml permissions: contents: write diff --git "a/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" "b/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" index 7bdd0532..a24e9ad0 100644 --- "a/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" +++ "b/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" @@ -56,7 +56,7 @@ jobs: uses: ./.github/workflows/_docs.yml push_docs: - needs: docs + needs: [test, docs] uses: ./.github/workflows/_push_docs.yml permissions: contents: write From c2060f77b2602a2ffa6eba548a4c5565df298ee9 Mon Sep 17 00:00:00 2001 From: Daniel Fernandes Date: Wed, 16 Apr 2025 08:23:26 +0000 Subject: [PATCH 14/49] Make release depend on test --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 10c0d01d..67ade50a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,7 +47,7 @@ jobs: release: if: github.ref_type == 'tag' - needs: docs + needs: [test, docs] uses: ./.github/workflows/_release.yml permissions: contents: write From 7894539584e2d11997f8fb1bb8d36eeb44d1c35e Mon Sep 17 00:00:00 2001 From: Daniel Fernandes Date: Wed, 16 Apr 2025 10:30:19 +0000 Subject: [PATCH 15/49] Rename _push_docs job to publish --- .github/workflows/_push_docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/_push_docs.yml b/.github/workflows/_push_docs.yml index 790b28fa..5061a54d 100644 --- a/.github/workflows/_push_docs.yml +++ b/.github/workflows/_push_docs.yml @@ -2,7 +2,7 @@ on: workflow_call: jobs: - build: + publish: runs-on: ubuntu-latest steps: From 6d9dff844dfe53c916b4fed34726b9634320f616 Mon Sep 17 00:00:00 2001 From: Daniel Fernandes Date: Wed, 16 Apr 2025 10:33:05 +0000 Subject: [PATCH 16/49] Move _push_docs condition into ci --- .github/workflows/_push_docs.yml | 1 - .github/workflows/ci.yml | 1 + .../workflows/ci.yml.jinja" | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/_push_docs.yml b/.github/workflows/_push_docs.yml index 5061a54d..379e27d8 100644 --- a/.github/workflows/_push_docs.yml +++ b/.github/workflows/_push_docs.yml @@ -28,7 +28,6 @@ jobs: run: python .github/pages/make_switcher.py --add $DOCS_VERSION ${{ github.repository }} .github/pages/switcher.json - name: Publish Docs to gh-pages - if: github.ref_type == 'tag' || github.ref_name == 'main' # We pin to the SHA, not the tag, for security reasons. # https://docs.github.com/en/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 67ade50a..e7ea8293 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,6 +34,7 @@ jobs: push_docs: needs: [test, docs] + if: github.ref_type == 'tag' || github.ref_name == 'main' uses: ./.github/workflows/_push_docs.yml permissions: contents: write diff --git "a/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" "b/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" index a24e9ad0..1f137445 100644 --- "a/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" +++ "b/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" @@ -57,6 +57,7 @@ jobs: push_docs: needs: [test, docs] + if: github.ref_type == 'tag' || github.ref_name == 'main' uses: ./.github/workflows/_push_docs.yml permissions: contents: write From 80178a82385eb8dbe77078a4d2490a87a8d5847b Mon Sep 17 00:00:00 2001 From: Daniel Fernandes Date: Wed, 16 Apr 2025 13:56:47 +0000 Subject: [PATCH 17/49] Add Load Image step --- .github/workflows/_container.yml | 3 ++- .github/workflows/_push_container.yml | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/_container.yml b/.github/workflows/_container.yml index bec61a29..ed43c3bb 100644 --- a/.github/workflows/_container.yml +++ b/.github/workflows/_container.yml @@ -33,6 +33,7 @@ jobs: # Need load and tags so we can test it below load: true tags: tag_for_testing + outputs: dest=${{ runner.temp }}/myimage.tar - name: Test cli works in cached runtime image run: docker run --rm tag_for_testing --version @@ -41,4 +42,4 @@ jobs: uses: actions/upload-artifact@v4 with: name: container - path: container + path: ${{ runner.temp }}/myimage.tar diff --git a/.github/workflows/_push_container.yml b/.github/workflows/_push_container.yml index 49900927..a2fdc46b 100644 --- a/.github/workflows/_push_container.yml +++ b/.github/workflows/_push_container.yml @@ -10,7 +10,11 @@ jobs: uses: actions/download-artifact@v4 with: name: container - path: container + path: ${{ runner.temp }} + + - name: Load image + run: | + docker load --input ${{ runner.temp}}/myimage.tar - name: Create tags for publishing image id: meta From 816687c78c50ead9ca35e3a2e504f4cec315f685 Mon Sep 17 00:00:00 2001 From: Daniel Fernandes Date: Wed, 16 Apr 2025 14:10:06 +0000 Subject: [PATCH 18/49] Remove load from build-push-action --- .github/workflows/_container.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/_container.yml b/.github/workflows/_container.yml index ed43c3bb..380f07ee 100644 --- a/.github/workflows/_container.yml +++ b/.github/workflows/_container.yml @@ -31,9 +31,8 @@ jobs: with: context: . # Need load and tags so we can test it below - load: true tags: tag_for_testing - outputs: dest=${{ runner.temp }}/myimage.tar + outputs: type=docker,dest=${{ runner.temp }}/myimage.tar - name: Test cli works in cached runtime image run: docker run --rm tag_for_testing --version From 07883592a44aa5564f7ff8e589bea0e0a5d49c67 Mon Sep 17 00:00:00 2001 From: Daniel Fernandes Date: Wed, 16 Apr 2025 14:16:55 +0000 Subject: [PATCH 19/49] Remove context --- .github/workflows/_push_container.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/_push_container.yml b/.github/workflows/_push_container.yml index a2fdc46b..fb201859 100644 --- a/.github/workflows/_push_container.yml +++ b/.github/workflows/_push_container.yml @@ -33,7 +33,6 @@ jobs: # This does not build the image again, it will find the image in the # Docker cache and publish it with: - context: . push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} From ad034185dc2a30af3ab34e9a6cb9ad8cdd2f3b43 Mon Sep 17 00:00:00 2001 From: Daniel Fernandes Date: Wed, 30 Apr 2025 13:06:28 +0000 Subject: [PATCH 20/49] Make both _container.yml and _push_container.yml build and test container --- .github/workflows/_container.yml | 6 ---- .github/workflows/_push_container.yml | 42 ++++++++++++++++++++------- 2 files changed, 32 insertions(+), 16 deletions(-) diff --git a/.github/workflows/_container.yml b/.github/workflows/_container.yml index 380f07ee..74cc19b8 100644 --- a/.github/workflows/_container.yml +++ b/.github/workflows/_container.yml @@ -36,9 +36,3 @@ jobs: - name: Test cli works in cached runtime image run: docker run --rm tag_for_testing --version - - - name: Upload container as artifact - uses: actions/upload-artifact@v4 - with: - name: container - path: ${{ runner.temp }}/myimage.tar diff --git a/.github/workflows/_push_container.yml b/.github/workflows/_push_container.yml index fb201859..da5e4936 100644 --- a/.github/workflows/_push_container.yml +++ b/.github/workflows/_push_container.yml @@ -2,20 +2,41 @@ on: workflow_call: jobs: - push: + build: runs-on: ubuntu-latest steps: - - name: Download container artifact - uses: actions/download-artifact@v4 + - name: Checkout + uses: actions/checkout@v4 with: - name: container - path: ${{ runner.temp }} - - - name: Load image - run: | - docker load --input ${{ runner.temp}}/myimage.tar - + # Need this to get version number from last tag + fetch-depth: 0 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to GitHub Docker Registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and export to Docker local cache + uses: docker/build-push-action@v6 + env: + DOCKER_BUILD_RECORD_UPLOAD: false + with: + context: . + # Need load and tags so we can test it below + load: true + tags: tag_for_testing + + - name: Test cli works in cached runtime image + run: docker run --rm tag_for_testing --version + - name: Create tags for publishing image id: meta uses: docker/metadata-action@v5 @@ -33,6 +54,7 @@ jobs: # This does not build the image again, it will find the image in the # Docker cache and publish it with: + context: . push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} From 965f51f22c8a801f003dd06abcc1791436c3e706 Mon Sep 17 00:00:00 2001 From: Daniel Fernandes Date: Wed, 30 Apr 2025 13:08:51 +0000 Subject: [PATCH 21/49] Make both _docs.yml and _push_docs.yml build docs --- .github/workflows/_push_docs.yml | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/.github/workflows/_push_docs.yml b/.github/workflows/_push_docs.yml index 379e27d8..a1cafcae 100644 --- a/.github/workflows/_push_docs.yml +++ b/.github/workflows/_push_docs.yml @@ -2,24 +2,40 @@ on: workflow_call: jobs: - publish: + build: runs-on: ubuntu-latest steps: + - name: Avoid git conflicts when tag and branch pushed at same time + if: github.ref_type == 'tag' + run: sleep 60 + - name: Checkout uses: actions/checkout@v4 with: # Need this to get version number from last tag fetch-depth: 0 - - name: Download built docs artifact - uses: actions/download-artifact@v4 + - name: Install system packages + run: sudo apt-get install graphviz + + - name: Install python packages + uses: ./.github/actions/install_requirements + + - name: Build docs + run: tox -e docs + + - name: Remove environment.pickle + run: rm build/html/.doctrees/environment.pickle + + - name: Upload built docs artifact + uses: actions/upload-artifact@v4 with: name: docs path: build - name: Sanitize ref name for docs version - run: echo "DOCS_VERSION=${GITHUB_REF_NAME//[^A-Za-z-1-9._-]/_}" >> $GITHUB_ENV + run: echo "DOCS_VERSION=${GITHUB_REF_NAME//[^A-Za-z0-9._-]/_}" >> $GITHUB_ENV - name: Move to versioned directory run: mv build/html .github/pages/$DOCS_VERSION @@ -28,6 +44,7 @@ jobs: run: python .github/pages/make_switcher.py --add $DOCS_VERSION ${{ github.repository }} .github/pages/switcher.json - name: Publish Docs to gh-pages + if: github.ref_type == 'tag' || github.ref_name == 'main' # We pin to the SHA, not the tag, for security reasons. # https://docs.github.com/en/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0 From 67b49d7e270fad12b2b8b18ad56cbf6b72686da6 Mon Sep 17 00:00:00 2001 From: Daniel Fernandes Date: Wed, 30 Apr 2025 13:25:27 +0000 Subject: [PATCH 22/49] Re-add removed load attribute --- .github/workflows/_container.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/_container.yml b/.github/workflows/_container.yml index 74cc19b8..65038d73 100644 --- a/.github/workflows/_container.yml +++ b/.github/workflows/_container.yml @@ -31,6 +31,7 @@ jobs: with: context: . # Need load and tags so we can test it below + load: true tags: tag_for_testing outputs: type=docker,dest=${{ runner.temp }}/myimage.tar From 0d09bb2f4c5a8b2163a2c5732bb0052312c66e04 Mon Sep 17 00:00:00 2001 From: Daniel Fernandes Date: Thu, 1 May 2025 08:44:28 +0100 Subject: [PATCH 23/49] Remove output parameter to container build --- .github/workflows/_container.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/_container.yml b/.github/workflows/_container.yml index 65038d73..f5b864c7 100644 --- a/.github/workflows/_container.yml +++ b/.github/workflows/_container.yml @@ -33,7 +33,6 @@ jobs: # Need load and tags so we can test it below load: true tags: tag_for_testing - outputs: type=docker,dest=${{ runner.temp }}/myimage.tar - name: Test cli works in cached runtime image run: docker run --rm tag_for_testing --version From 85d167145a316c6c4177dbd7c0c9b28a764e3a5c Mon Sep 17 00:00:00 2001 From: Daniel Fernandes Date: Thu, 1 May 2025 08:53:09 +0100 Subject: [PATCH 24/49] Remove document artifact upload in _push_docs to avoid duplicate artifact --- .github/workflows/_push_docs.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/_push_docs.yml b/.github/workflows/_push_docs.yml index a1cafcae..efc99380 100644 --- a/.github/workflows/_push_docs.yml +++ b/.github/workflows/_push_docs.yml @@ -28,12 +28,6 @@ jobs: - name: Remove environment.pickle run: rm build/html/.doctrees/environment.pickle - - name: Upload built docs artifact - uses: actions/upload-artifact@v4 - with: - name: docs - path: build - - name: Sanitize ref name for docs version run: echo "DOCS_VERSION=${GITHUB_REF_NAME//[^A-Za-z0-9._-]/_}" >> $GITHUB_ENV From feb4bc1a50fa3d23687f5e00fab0a6d120488f34 Mon Sep 17 00:00:00 2001 From: Daniel Fernandes Date: Wed, 7 May 2025 15:28:47 +0100 Subject: [PATCH 25/49] Remove all _push_container.yml and _push_docs.yml --- .github/workflows/_push_container.yml | 60 ------------------- .github/workflows/_push_docs.yml | 48 --------------- .../workflows/ci.yml.jinja" | 15 ----- ...f docker %}_push_container.yml{% endif %}" | 1 - .../{% if sphinx %}_push_docs.yml{% endif %}" | 1 - 5 files changed, 125 deletions(-) delete mode 100644 .github/workflows/_push_container.yml delete mode 100644 .github/workflows/_push_docs.yml delete mode 120000 "template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/{% if docker %}_push_container.yml{% endif %}" delete mode 120000 "template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/{% if sphinx %}_push_docs.yml{% endif %}" diff --git a/.github/workflows/_push_container.yml b/.github/workflows/_push_container.yml deleted file mode 100644 index da5e4936..00000000 --- a/.github/workflows/_push_container.yml +++ /dev/null @@ -1,60 +0,0 @@ -on: - workflow_call: - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - # Need this to get version number from last tag - fetch-depth: 0 - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v3 - - - name: Log in to GitHub Docker Registry - if: github.event_name != 'pull_request' - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build and export to Docker local cache - uses: docker/build-push-action@v6 - env: - DOCKER_BUILD_RECORD_UPLOAD: false - with: - context: . - # Need load and tags so we can test it below - load: true - tags: tag_for_testing - - - name: Test cli works in cached runtime image - run: docker run --rm tag_for_testing --version - - - name: Create tags for publishing image - id: meta - uses: docker/metadata-action@v5 - with: - images: ghcr.io/${{ github.repository }} - tags: | - type=ref,event=tag - type=raw,value=latest - - - name: Push cached image to container registry - if: github.ref_type == 'tag' - uses: docker/build-push-action@v6 - env: - DOCKER_BUILD_RECORD_UPLOAD: false - # This does not build the image again, it will find the image in the - # Docker cache and publish it - with: - context: . - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/_push_docs.yml b/.github/workflows/_push_docs.yml deleted file mode 100644 index efc99380..00000000 --- a/.github/workflows/_push_docs.yml +++ /dev/null @@ -1,48 +0,0 @@ -on: - workflow_call: - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: Avoid git conflicts when tag and branch pushed at same time - if: github.ref_type == 'tag' - run: sleep 60 - - - name: Checkout - uses: actions/checkout@v4 - with: - # Need this to get version number from last tag - fetch-depth: 0 - - - name: Install system packages - run: sudo apt-get install graphviz - - - name: Install python packages - uses: ./.github/actions/install_requirements - - - name: Build docs - run: tox -e docs - - - name: Remove environment.pickle - run: rm build/html/.doctrees/environment.pickle - - - name: Sanitize ref name for docs version - run: echo "DOCS_VERSION=${GITHUB_REF_NAME//[^A-Za-z0-9._-]/_}" >> $GITHUB_ENV - - - name: Move to versioned directory - run: mv build/html .github/pages/$DOCS_VERSION - - - name: Write switcher.json - run: python .github/pages/make_switcher.py --add $DOCS_VERSION ${{ github.repository }} .github/pages/switcher.json - - - name: Publish Docs to gh-pages - if: github.ref_type == 'tag' || github.ref_name == 'main' - # We pin to the SHA, not the tag, for security reasons. - # https://docs.github.com/en/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions - uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: .github/pages - keep_files: true diff --git "a/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" "b/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" index 1f137445..98d9d938 100644 --- "a/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" +++ "b/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" @@ -41,26 +41,11 @@ jobs: permissions: contents: read packages: write - - push_container: - if: github.ref_type == 'tag' - needs: [container, test] - uses: ./.github/workflows/_push_container.yml - permissions: - contents: read - packages: write {% endif %}{% if sphinx %} docs: needs: check if: needs.check.outputs.branch-pr == '' uses: ./.github/workflows/_docs.yml - - push_docs: - needs: [test, docs] - if: github.ref_type == 'tag' || github.ref_name == 'main' - uses: ./.github/workflows/_push_docs.yml - permissions: - contents: write {% endif %} dist: needs: check diff --git "a/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/{% if docker %}_push_container.yml{% endif %}" "b/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/{% if docker %}_push_container.yml{% endif %}" deleted file mode 120000 index daeafe96..00000000 --- "a/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/{% if docker %}_push_container.yml{% endif %}" +++ /dev/null @@ -1 +0,0 @@ -../../../.github/workflows/_push_container.yml \ No newline at end of file diff --git "a/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/{% if sphinx %}_push_docs.yml{% endif %}" "b/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/{% if sphinx %}_push_docs.yml{% endif %}" deleted file mode 120000 index 0c8d3868..00000000 --- "a/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/{% if sphinx %}_push_docs.yml{% endif %}" +++ /dev/null @@ -1 +0,0 @@ -../../../.github/workflows/_push_docs.yml \ No newline at end of file From 87f2f367debc6b122308b09bdda23342f7113265 Mon Sep 17 00:00:00 2001 From: Daniel Fernandes Date: Wed, 7 May 2025 15:32:49 +0100 Subject: [PATCH 26/49] Add pushing back into _container conditional on needs.test.result --- .github/workflows/_container.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/.github/workflows/_container.yml b/.github/workflows/_container.yml index f5b864c7..7c8fb66b 100644 --- a/.github/workflows/_container.yml +++ b/.github/workflows/_container.yml @@ -36,3 +36,25 @@ jobs: - name: Test cli works in cached runtime image run: docker run --rm tag_for_testing --version + + - name: Create tags for publishing image + id: meta + uses: docker/metadata-action@v5 + with: + images: ghcr.io/${{ github.repository }} + tags: | + type=ref,event=tag + type=raw,value=latest + + - name: Push cached image to container registry + if: needs.test.result && github.ref_type == 'tag' + uses: docker/build-push-action@v6 + env: + DOCKER_BUILD_RECORD_UPLOAD: false + # This does not build the image again, it will find the image in the + # Docker cache and publish it + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} From 9ed4d31b59b561521adb6f5d27c7659cd8cc08ba Mon Sep 17 00:00:00 2001 From: Daniel Fernandes Date: Wed, 7 May 2025 15:35:19 +0100 Subject: [PATCH 27/49] Add pushing back into _docs.yml conditional on needs.test.result --- .github/workflows/_docs.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/workflows/_docs.yml b/.github/workflows/_docs.yml index 90485e64..a574d16f 100644 --- a/.github/workflows/_docs.yml +++ b/.github/workflows/_docs.yml @@ -33,3 +33,22 @@ jobs: with: name: docs path: build + + - name: Sanitize ref name for docs version + run: echo "DOCS_VERSION=${GITHUB_REF_NAME//[^A-Za-z0-9._-]/_}" >> $GITHUB_ENV + + - name: Move to versioned directory + run: mv build/html .github/pages/$DOCS_VERSION + + - name: Write switcher.json + run: python .github/pages/make_switcher.py --add $DOCS_VERSION ${{ github.repository }} .github/pages/switcher.json + + - name: Publish Docs to gh-pages + if: needs.test.result && (github.ref_type == 'tag' || github.ref_name == 'main') + # We pin to the SHA, not the tag, for security reasons. + # https://docs.github.com/en/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions + uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: .github/pages + keep_files: true From d13e5cec0a75d7666ef171cf787766b0ed2180d0 Mon Sep 17 00:00:00 2001 From: Daniel Fernandes Date: Wed, 7 May 2025 15:36:52 +0100 Subject: [PATCH 28/49] Remove _push_docs.yml reference in ci --- .github/workflows/ci.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e7ea8293..661929bb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,13 +32,6 @@ jobs: permissions: contents: write - push_docs: - needs: [test, docs] - if: github.ref_type == 'tag' || github.ref_name == 'main' - uses: ./.github/workflows/_push_docs.yml - permissions: - contents: write - example: needs: test if: github.ref_name == 'main' From 2e9f1fa0af65c1bbe92c84c7640d84d30d246693 Mon Sep 17 00:00:00 2001 From: Daniel Fernandes Date: Wed, 7 May 2025 15:39:50 +0100 Subject: [PATCH 29/49] Make docs, container workflows need test workflow --- .github/workflows/ci.yml | 2 +- .../workflows/ci.yml.jinja" | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 661929bb..dd27562b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,7 @@ jobs: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} docs: - needs: check + needs: [check, test] if: needs.check.outputs.branch-pr == '' uses: ./.github/workflows/_docs.yml permissions: diff --git "a/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" "b/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" index 98d9d938..b0673f62 100644 --- "a/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" +++ "b/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" @@ -35,7 +35,7 @@ jobs: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} {% endraw %}{% if docker %} container: - needs: check + needs: [check, test] if: needs.check.outputs.branch-pr == '' uses: ./.github/workflows/_container.yml permissions: @@ -43,7 +43,7 @@ jobs: packages: write {% endif %}{% if sphinx %} docs: - needs: check + needs: [check, test] if: needs.check.outputs.branch-pr == '' uses: ./.github/workflows/_docs.yml {% endif %} From 6a402b16edb35ac083c7bb1c4b302ed404607d2d Mon Sep 17 00:00:00 2001 From: Daniel Fernandes Date: Wed, 7 May 2025 15:42:50 +0100 Subject: [PATCH 30/49] Fix conditional on pypi, release and dist workflows to rely on tests passing --- .github/workflows/ci.yml | 2 +- .../workflows/ci.yml.jinja" | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dd27562b..209c82b7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,7 +40,7 @@ jobs: EXAMPLE_DEPLOY_KEY: ${{ secrets.EXAMPLE_DEPLOY_KEY }} release: - if: github.ref_type == 'tag' + if: needs.test.result && github.ref_type == 'tag' needs: [test, docs] uses: ./.github/workflows/_release.yml permissions: diff --git "a/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" "b/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" index b0673f62..3377fbef 100644 --- "a/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" +++ "b/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" @@ -49,7 +49,7 @@ jobs: {% endif %} dist: needs: check - if: needs.check.outputs.branch-pr == '' + if: needs.test.output && needs.check.outputs.branch-pr == '' uses: ./.github/workflows/_dist.yml {% if pypi %} pypi: @@ -60,7 +60,7 @@ jobs: id-token: write {% endif %} release: - if: github.ref_type == 'tag' + if: needs.test.output && github.ref_type == 'tag' needs: [dist, test{% if sphinx %}, docs{% endif %}] uses: ./.github/workflows/_release.yml permissions: From ad37180f9b65f357f2ae4161ebb4fbafd5213493 Mon Sep 17 00:00:00 2001 From: Daniel Fernandes Date: Thu, 8 May 2025 09:09:55 +0000 Subject: [PATCH 31/49] Fix broken needs.test conditionals --- .github/workflows/ci.yml | 2 +- .../workflows/ci.yml.jinja" | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 209c82b7..d32ef1d0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,7 +40,7 @@ jobs: EXAMPLE_DEPLOY_KEY: ${{ secrets.EXAMPLE_DEPLOY_KEY }} release: - if: needs.test.result && github.ref_type == 'tag' + if: needs.test.result == 'success' && github.ref_type == 'tag' needs: [test, docs] uses: ./.github/workflows/_release.yml permissions: diff --git "a/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" "b/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" index 3377fbef..5b9d870c 100644 --- "a/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" +++ "b/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" @@ -49,7 +49,7 @@ jobs: {% endif %} dist: needs: check - if: needs.test.output && needs.check.outputs.branch-pr == '' + if: needs.test.result == 'success' && needs.check.outputs.branch-pr == '' uses: ./.github/workflows/_dist.yml {% if pypi %} pypi: @@ -60,7 +60,7 @@ jobs: id-token: write {% endif %} release: - if: needs.test.output && github.ref_type == 'tag' + if: needs.test.result == 'success' && github.ref_type == 'tag' needs: [dist, test{% if sphinx %}, docs{% endif %}] uses: ./.github/workflows/_release.yml permissions: From 78fa020622a83bdc20f9ec74accace1c8463af46 Mon Sep 17 00:00:00 2001 From: Daniel Fernandes Date: Thu, 8 May 2025 09:18:15 +0000 Subject: [PATCH 32/49] Add publish input to _docs.yml --- .github/workflows/_docs.yml | 7 ++++++- .github/workflows/ci.yml | 2 ++ .../workflows/ci.yml.jinja" | 3 +++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/_docs.yml b/.github/workflows/_docs.yml index a574d16f..e9e8ad97 100644 --- a/.github/workflows/_docs.yml +++ b/.github/workflows/_docs.yml @@ -1,5 +1,10 @@ on: workflow_call: + inputs: + publish: + type: boolean + description: If true, publishes docs to gh-pages + jobs: build: @@ -44,7 +49,7 @@ jobs: run: python .github/pages/make_switcher.py --add $DOCS_VERSION ${{ github.repository }} .github/pages/switcher.json - name: Publish Docs to gh-pages - if: needs.test.result && (github.ref_type == 'tag' || github.ref_name == 'main') + if: inputs.publish && (github.ref_type == 'tag' || github.ref_name == 'main') # We pin to the SHA, not the tag, for security reasons. # https://docs.github.com/en/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d32ef1d0..22849aa7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,6 +29,8 @@ jobs: needs: [check, test] if: needs.check.outputs.branch-pr == '' uses: ./.github/workflows/_docs.yml + with: + publish: ${{needs.test.result == 'success'}} permissions: contents: write diff --git "a/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" "b/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" index 5b9d870c..02bd1866 100644 --- "a/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" +++ "b/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" @@ -46,6 +46,9 @@ jobs: needs: [check, test] if: needs.check.outputs.branch-pr == '' uses: ./.github/workflows/_docs.yml + with: + publish: ${{needs.test.result == 'success'}} + {% endif %} dist: needs: check From f8e15cd635e858eba5a6900c5952e06880ebcaf8 Mon Sep 17 00:00:00 2001 From: Daniel Fernandes Date: Thu, 8 May 2025 09:19:48 +0000 Subject: [PATCH 33/49] Add publish input to _container.yml --- .github/workflows/_container.yml | 6 +++++- .../workflows/ci.yml.jinja" | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/_container.yml b/.github/workflows/_container.yml index 7c8fb66b..99cef8f2 100644 --- a/.github/workflows/_container.yml +++ b/.github/workflows/_container.yml @@ -1,5 +1,9 @@ on: workflow_call: + inputs: + publish: + type: boolean + description: If true, publishes docs to gh-pages jobs: build: @@ -47,7 +51,7 @@ jobs: type=raw,value=latest - name: Push cached image to container registry - if: needs.test.result && github.ref_type == 'tag' + if: inputs.publish && github.ref_type == 'tag' uses: docker/build-push-action@v6 env: DOCKER_BUILD_RECORD_UPLOAD: false diff --git "a/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" "b/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" index 02bd1866..8e54dfe4 100644 --- "a/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" +++ "b/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" @@ -38,6 +38,8 @@ jobs: needs: [check, test] if: needs.check.outputs.branch-pr == '' uses: ./.github/workflows/_container.yml + with: + publish: ${{needs.test.result == 'success'}} permissions: contents: read packages: write From 88f18ac019e9070ff29536207ce85ba9b6bf0472 Mon Sep 17 00:00:00 2001 From: Daniel Fernandes Date: Thu, 8 May 2025 09:21:00 +0000 Subject: [PATCH 34/49] Fix publish input description --- .github/workflows/_container.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/_container.yml b/.github/workflows/_container.yml index 99cef8f2..c6cd4697 100644 --- a/.github/workflows/_container.yml +++ b/.github/workflows/_container.yml @@ -3,7 +3,7 @@ on: inputs: publish: type: boolean - description: If true, publishes docs to gh-pages + description: If true, pushes image to container registry jobs: build: From 2d6643877a193ea7d949d1b665568f154f56aebc Mon Sep 17 00:00:00 2001 From: Daniel Fernandes Date: Thu, 8 May 2025 09:22:27 +0000 Subject: [PATCH 35/49] Add test to dist.needs --- .../workflows/ci.yml.jinja" | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git "a/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" "b/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" index 8e54dfe4..9a63fb8f 100644 --- "a/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" +++ "b/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" @@ -53,7 +53,7 @@ jobs: {% endif %} dist: - needs: check + needs: [check, test] if: needs.test.result == 'success' && needs.check.outputs.branch-pr == '' uses: ./.github/workflows/_dist.yml {% if pypi %} From 92866d9b295110841569b3867cf6681828a2c3a7 Mon Sep 17 00:00:00 2001 From: Daniel Fernandes Date: Thu, 8 May 2025 09:24:46 +0000 Subject: [PATCH 36/49] Remove test from pypi.needs --- .../workflows/ci.yml.jinja" | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git "a/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" "b/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" index 9a63fb8f..157b0437 100644 --- "a/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" +++ "b/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" @@ -59,7 +59,7 @@ jobs: {% if pypi %} pypi: if: github.ref_type == 'tag' - needs: [dist, test] + needs: [dist] uses: ./.github/workflows/_pypi.yml permissions: id-token: write From fa594290a324b0e718aaaed9ac50495c386bb550 Mon Sep 17 00:00:00 2001 From: Daniel Fernandes Date: Thu, 8 May 2025 09:25:46 +0000 Subject: [PATCH 37/49] Ammend pypi.if to require dist result success --- .../workflows/ci.yml.jinja" | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git "a/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" "b/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" index 157b0437..9a6e6f45 100644 --- "a/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" +++ "b/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" @@ -58,7 +58,7 @@ jobs: uses: ./.github/workflows/_dist.yml {% if pypi %} pypi: - if: github.ref_type == 'tag' + if: needs.dist.result == 'success' && github.ref_type == 'tag' needs: [dist] uses: ./.github/workflows/_pypi.yml permissions: From 80be825f749ef620046013a438351e515252a5f6 Mon Sep 17 00:00:00 2001 From: Daniel Fernandes Date: Thu, 8 May 2025 09:33:11 +0000 Subject: [PATCH 38/49] Remove dist.needs.test, add pypi.needs.test --- .../workflows/ci.yml.jinja" | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git "a/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" "b/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" index 9a6e6f45..f7bad4cc 100644 --- "a/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" +++ "b/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" @@ -53,13 +53,13 @@ jobs: {% endif %} dist: - needs: [check, test] - if: needs.test.result == 'success' && needs.check.outputs.branch-pr == '' + needs: check + if: needs.check.outputs.branch-pr == '' uses: ./.github/workflows/_dist.yml {% if pypi %} pypi: if: needs.dist.result == 'success' && github.ref_type == 'tag' - needs: [dist] + needs: [dist, test] uses: ./.github/workflows/_pypi.yml permissions: id-token: write From 18efa67e9f7370e42724f6224573a65997b17f20 Mon Sep 17 00:00:00 2001 From: Daniel Fernandes Date: Thu, 8 May 2025 09:33:47 +0000 Subject: [PATCH 39/49] Add needs.test.result to pypi conditional --- .../workflows/ci.yml.jinja" | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git "a/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" "b/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" index f7bad4cc..b528ff7a 100644 --- "a/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" +++ "b/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" @@ -58,7 +58,7 @@ jobs: uses: ./.github/workflows/_dist.yml {% if pypi %} pypi: - if: needs.dist.result == 'success' && github.ref_type == 'tag' + if: needs.dist.result == 'success' && needs.test.result == 'success' && github.ref_type == 'tag' needs: [dist, test] uses: ./.github/workflows/_pypi.yml permissions: From 60dec893371c109a8323beab8c49a1ee5ecf7844 Mon Sep 17 00:00:00 2001 From: Daniel Fernandes Date: Thu, 8 May 2025 09:40:38 +0000 Subject: [PATCH 40/49] Standardise order of needs/if --- .github/workflows/ci.yml | 2 +- .../workflows/ci.yml.jinja" | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 22849aa7..d6de08ba 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,8 +42,8 @@ jobs: EXAMPLE_DEPLOY_KEY: ${{ secrets.EXAMPLE_DEPLOY_KEY }} release: - if: needs.test.result == 'success' && github.ref_type == 'tag' needs: [test, docs] + if: needs.test.result == 'success' && github.ref_type == 'tag' uses: ./.github/workflows/_release.yml permissions: contents: write diff --git "a/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" "b/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" index b528ff7a..3de5ec96 100644 --- "a/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" +++ "b/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" @@ -58,15 +58,15 @@ jobs: uses: ./.github/workflows/_dist.yml {% if pypi %} pypi: - if: needs.dist.result == 'success' && needs.test.result == 'success' && github.ref_type == 'tag' needs: [dist, test] + if: needs.dist.result == 'success' && needs.test.result == 'success' && github.ref_type == 'tag' uses: ./.github/workflows/_pypi.yml permissions: id-token: write {% endif %} release: - if: needs.test.result == 'success' && github.ref_type == 'tag' needs: [dist, test{% if sphinx %}, docs{% endif %}] + if: needs.test.result == 'success' && github.ref_type == 'tag' uses: ./.github/workflows/_release.yml permissions: contents: write From 82acbe50e4916da37da41f86203a398e697bbed9 Mon Sep 17 00:00:00 2001 From: Daniel Fernandes Date: Thu, 8 May 2025 09:43:39 +0000 Subject: [PATCH 41/49] Add needs.dist.result success to release conditional --- .../workflows/ci.yml.jinja" | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git "a/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" "b/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" index 3de5ec96..31041dc1 100644 --- "a/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" +++ "b/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" @@ -66,7 +66,7 @@ jobs: {% endif %} release: needs: [dist, test{% if sphinx %}, docs{% endif %}] - if: needs.test.result == 'success' && github.ref_type == 'tag' + if: needs.dist.result == 'success' && needs.test.result == 'success' && github.ref_type == 'tag' uses: ./.github/workflows/_release.yml permissions: contents: write From acb8f6d8fe474cd322aa258e15010a4fe4bc177b Mon Sep 17 00:00:00 2001 From: Daniel Fernandes Date: Thu, 8 May 2025 10:04:03 +0000 Subject: [PATCH 42/49] Add always() to docs conditional --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d6de08ba..fe989ab3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,7 +27,7 @@ jobs: docs: needs: [check, test] - if: needs.check.outputs.branch-pr == '' + if: always() && needs.check.outputs.branch-pr == '' uses: ./.github/workflows/_docs.yml with: publish: ${{needs.test.result == 'success'}} From aac4043d90e938d1186b54949888b5c467802c5f Mon Sep 17 00:00:00 2001 From: Daniel Fernandes Date: Thu, 8 May 2025 10:08:07 +0000 Subject: [PATCH 43/49] Remove uneccesary needs.*.result from conditionals --- .github/workflows/ci.yml | 2 +- .../workflows/ci.yml.jinja" | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fe989ab3..e980b71b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,7 +43,7 @@ jobs: release: needs: [test, docs] - if: needs.test.result == 'success' && github.ref_type == 'tag' + if: github.ref_type == 'tag' uses: ./.github/workflows/_release.yml permissions: contents: write diff --git "a/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" "b/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" index 31041dc1..ed5ac659 100644 --- "a/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" +++ "b/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" @@ -59,14 +59,14 @@ jobs: {% if pypi %} pypi: needs: [dist, test] - if: needs.dist.result == 'success' && needs.test.result == 'success' && github.ref_type == 'tag' + if: github.ref_type == 'tag' uses: ./.github/workflows/_pypi.yml permissions: id-token: write {% endif %} release: needs: [dist, test{% if sphinx %}, docs{% endif %}] - if: needs.dist.result == 'success' && needs.test.result == 'success' && github.ref_type == 'tag' + if: github.ref_type == 'tag' uses: ./.github/workflows/_release.yml permissions: contents: write From d39ee6f6bc394491f80a3960273fb368480975d5 Mon Sep 17 00:00:00 2001 From: Daniel Fernandes Date: Thu, 8 May 2025 10:09:26 +0000 Subject: [PATCH 44/49] Add always() to docs and container conditionals --- .../workflows/ci.yml.jinja" | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git "a/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" "b/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" index ed5ac659..2c9079f2 100644 --- "a/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" +++ "b/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" @@ -36,7 +36,7 @@ jobs: {% endraw %}{% if docker %} container: needs: [check, test] - if: needs.check.outputs.branch-pr == '' + if: always() && needs.check.outputs.branch-pr == '' uses: ./.github/workflows/_container.yml with: publish: ${{needs.test.result == 'success'}} @@ -46,7 +46,7 @@ jobs: {% endif %}{% if sphinx %} docs: needs: [check, test] - if: needs.check.outputs.branch-pr == '' + if: always() && needs.check.outputs.branch-pr == '' uses: ./.github/workflows/_docs.yml with: publish: ${{needs.test.result == 'success'}} From 319c71a46f554c53596067ae6ff5747c775412b5 Mon Sep 17 00:00:00 2001 From: Daniel Fernandes Date: Thu, 8 May 2025 10:48:25 +0000 Subject: [PATCH 45/49] Replace needs with jobs in conditionals --- .../workflows/ci.yml.jinja" | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git "a/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" "b/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" index 2c9079f2..fe4efd5e 100644 --- "a/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" +++ "b/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" @@ -39,7 +39,7 @@ jobs: if: always() && needs.check.outputs.branch-pr == '' uses: ./.github/workflows/_container.yml with: - publish: ${{needs.test.result == 'success'}} + publish: ${{jobs.test.result == 'success'}} permissions: contents: read packages: write @@ -49,7 +49,7 @@ jobs: if: always() && needs.check.outputs.branch-pr == '' uses: ./.github/workflows/_docs.yml with: - publish: ${{needs.test.result == 'success'}} + publish: ${{jobs.test.result == 'success'}} {% endif %} dist: From a86f8c2c308bbd486822b7ddb4fb8a0b7881b931 Mon Sep 17 00:00:00 2001 From: Daniel Fernandes Date: Thu, 8 May 2025 12:57:20 +0000 Subject: [PATCH 46/49] Revert "Replace needs with jobs in conditionals" This reverts commit 319c71a46f554c53596067ae6ff5747c775412b5. --- .../workflows/ci.yml.jinja" | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git "a/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" "b/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" index fe4efd5e..2c9079f2 100644 --- "a/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" +++ "b/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" @@ -39,7 +39,7 @@ jobs: if: always() && needs.check.outputs.branch-pr == '' uses: ./.github/workflows/_container.yml with: - publish: ${{jobs.test.result == 'success'}} + publish: ${{needs.test.result == 'success'}} permissions: contents: read packages: write @@ -49,7 +49,7 @@ jobs: if: always() && needs.check.outputs.branch-pr == '' uses: ./.github/workflows/_docs.yml with: - publish: ${{jobs.test.result == 'success'}} + publish: ${{needs.test.result == 'success'}} {% endif %} dist: From a79e6e6de199f91de9411d7ad349418aac92e613 Mon Sep 17 00:00:00 2001 From: Daniel Fernandes Date: Thu, 8 May 2025 12:59:15 +0000 Subject: [PATCH 47/49] Add raw tags around blocks with gh action expressions --- .../workflows/ci.yml.jinja" | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git "a/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" "b/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" index 2c9079f2..a3501b76 100644 --- "a/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" +++ "b/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" @@ -33,25 +33,25 @@ jobs: python-version: ${{ matrix.python-version }} secrets: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} -{% endraw %}{% if docker %} +{% endraw %}{% if docker %}{% raw %} container: needs: [check, test] if: always() && needs.check.outputs.branch-pr == '' uses: ./.github/workflows/_container.yml with: - publish: ${{needs.test.result == 'success'}} + publish: ${{ needs.test.result == 'success' }} permissions: contents: read packages: write -{% endif %}{% if sphinx %} +{% endraw %}{% endif %}{% if sphinx %}{% raw %} docs: needs: [check, test] if: always() && needs.check.outputs.branch-pr == '' uses: ./.github/workflows/_docs.yml with: - publish: ${{needs.test.result == 'success'}} + publish: ${{ needs.test.result == 'success' }} -{% endif %} +{% endraw %}{% endif %} dist: needs: check if: needs.check.outputs.branch-pr == '' From 58dccf7503e8152fca12e921a24e9f771ca6d811 Mon Sep 17 00:00:00 2001 From: Daniel Fernandes <65790536+dan-fernandes@users.noreply.github.com> Date: Mon, 19 May 2025 09:57:24 +0100 Subject: [PATCH 48/49] Update ci.yml to remove depricated check depenency --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 57d5ea7a..4b5563bb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,7 @@ jobs: docs: needs: test - if: always() && needs.check.outputs.branch-pr == '' + if: always() uses: ./.github/workflows/_docs.yml with: publish: ${{needs.test.result == 'success'}} From 9b0a62b321b54ffefd9995fde309708a38b2d73f Mon Sep 17 00:00:00 2001 From: Daniel Fernandes Date: Tue, 10 Jun 2025 08:09:31 +0000 Subject: [PATCH 49/49] Remove docs workflow need test workflow --- .github/workflows/ci.yml | 2 -- .../workflows/ci.yml.jinja" | 2 -- 2 files changed, 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4b5563bb..4db61ffc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,8 +23,6 @@ jobs: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} docs: - needs: test - if: always() uses: ./.github/workflows/_docs.yml with: publish: ${{needs.test.result == 'success'}} diff --git "a/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" "b/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" index c874d16b..3879925a 100644 --- "a/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" +++ "b/template/{% if git_platform==\"github.com\" %}.github{% endif %}/workflows/ci.yml.jinja" @@ -39,8 +39,6 @@ jobs: packages: write {% endraw %}{% endif %}{% if sphinx %}{% raw %} docs: - needs: test - if: always() uses: ./.github/workflows/_docs.yml with: publish: ${{ needs.test.result == 'success' }}