From 34cb58877ba2c22df8a6d33e16739ae04bbe115e Mon Sep 17 00:00:00 2001 From: Saransh Chopra Date: Tue, 10 Oct 2023 22:05:11 +0530 Subject: [PATCH 1/4] Build wheels on the 1st and 15th of every month --- .github/workflows/publish_pypi.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish_pypi.yml b/.github/workflows/publish_pypi.yml index a009828e6f..a957562a2b 100644 --- a/.github/workflows/publish_pypi.yml +++ b/.github/workflows/publish_pypi.yml @@ -3,6 +3,9 @@ name: Build and publish package to PyPI on: release: types: [published] + schedule: + # Run at 10 am UTC on day-of-month 1 and 15. + - cron: "0 10 1,15 * *" workflow_dispatch: inputs: target: @@ -151,6 +154,7 @@ jobs: if-no-files-found: error publish_pypi: + if: github.event_name != 'schedule' name: Upload package to PyPI needs: [build_wheels, build_windows_wheels, build_sdist] runs-on: ubuntu-latest @@ -164,9 +168,7 @@ jobs: mv windows_wheels/* wheels/* sdist/* files/ - name: Publish on PyPI - if: | - github.event.inputs.target == 'pypi' || - (github.event_name == 'push' && github.ref == 'refs/heads/main') + if: github.event.inputs.target == 'pypi' || github.event_name == 'release' uses: pypa/gh-action-pypi-publish@release/v1 with: user: __token__ From 5c868c658434cfb2e6d185634cc674b972c5990f Mon Sep 17 00:00:00 2001 From: Saransh Chopra Date: Wed, 11 Oct 2023 00:22:01 +0530 Subject: [PATCH 2/4] Open an issue if the build fails --- .github/release_reminder.md | 1 + .github/wheel_failure.md | 6 ++++++ .github/workflows/publish_pypi.yml | 12 ++++++++++++ 3 files changed, 19 insertions(+) create mode 100644 .github/wheel_failure.md diff --git a/.github/release_reminder.md b/.github/release_reminder.md index 69696d03ec..94066e80c8 100644 --- a/.github/release_reminder.md +++ b/.github/release_reminder.md @@ -1,5 +1,6 @@ --- title: Create {{ date | date('YY.MM') }} (final or rc0) release +labels: priority:high --- Quarterly reminder to create a - diff --git a/.github/wheel_failure.md b/.github/wheel_failure.md new file mode 100644 index 0000000000..107b4dd6d6 --- /dev/null +++ b/.github/wheel_failure.md @@ -0,0 +1,6 @@ +--- +title: Fortnightly build for wheels failed +labels: priority:high, bug +--- + +The build is failing with the following logs - {{ env.LOGS }} diff --git a/.github/workflows/publish_pypi.yml b/.github/workflows/publish_pypi.yml index a957562a2b..c82a03fed5 100644 --- a/.github/workflows/publish_pypi.yml +++ b/.github/workflows/publish_pypi.yml @@ -183,3 +183,15 @@ jobs: password: ${{ secrets.TESTPYPI_TOKEN }} packages-dir: files/ repository-url: https://test.pypi.org/legacy/ + + open_failure_issue: + needs: [build_windows_wheels, buld_wheels, build_sdist] + if: ${{ always() && contains(needs.*.result, 'failure') }} + runs-on: ubuntu-latest + steps: + - uses: JasonEtco/create-an-issue@v2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + LOGS: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + with: + filename: .github/wheel_failure.md From d1bd29c9b9725191b17241755081c1204384b1b3 Mon Sep 17 00:00:00 2001 From: Saransh Chopra Date: Wed, 11 Oct 2023 00:23:31 +0530 Subject: [PATCH 3/4] Typo --- .github/workflows/publish_pypi.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish_pypi.yml b/.github/workflows/publish_pypi.yml index c82a03fed5..c48de9c4fd 100644 --- a/.github/workflows/publish_pypi.yml +++ b/.github/workflows/publish_pypi.yml @@ -185,7 +185,7 @@ jobs: repository-url: https://test.pypi.org/legacy/ open_failure_issue: - needs: [build_windows_wheels, buld_wheels, build_sdist] + needs: [build_windows_wheels, build_wheels, build_sdist] if: ${{ always() && contains(needs.*.result, 'failure') }} runs-on: ubuntu-latest steps: From 0e83ee5041bdb14aeafd9068d157d2216548c27f Mon Sep 17 00:00:00 2001 From: Saransh Chopra Date: Wed, 11 Oct 2023 00:57:29 +0530 Subject: [PATCH 4/4] checkout --- .github/workflows/publish_pypi.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/publish_pypi.yml b/.github/workflows/publish_pypi.yml index c48de9c4fd..25fbafc0af 100644 --- a/.github/workflows/publish_pypi.yml +++ b/.github/workflows/publish_pypi.yml @@ -186,9 +186,11 @@ jobs: open_failure_issue: needs: [build_windows_wheels, build_wheels, build_sdist] + name: Open an issue if build fails if: ${{ always() && contains(needs.*.result, 'failure') }} runs-on: ubuntu-latest steps: + - uses: actions/checkout@v4 - uses: JasonEtco/create-an-issue@v2 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}