From 3363851156ad312481a8195d78f809261db55f80 Mon Sep 17 00:00:00 2001 From: Danny Simms <103758200+GreyNewfie@users.noreply.github.com> Date: Wed, 22 Jan 2025 16:05:58 -0330 Subject: [PATCH 1/8] Separate Slack notification Replace the single Slack notification with separate notifications for successful or failed builds --- .github/workflows/ci.yml | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a63c398..982e8c8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -71,14 +71,27 @@ jobs: TWINE_USERNAME: "__token__" TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} - - name: Send Slack notification + - name: Send Slack notification for success + if: success() uses: 8398a7/action-slack@v3 with: - author_name: Python Server SDK - status: ${{ job.status }} - fields: repo,job - text: "PyPi Package: https://pypi.org/project/notificationapi-python-server-sdk" + author_name: Python Server SDK + status: ${{ job.status }} + fields: repo,message,commit,action,workflow,took + text: "PyPi Package: https://pypi.org/project/notificationapi-python-server-sdk" env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - if: always() + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_SUCCESS_WEBHOOK_URL }} + + - name: Send Slack notification for failure or cancellation + if: failure() || cancelled() + uses: 8398a7/action-slack@v3 + with: + author_name: Python Server SDK + status: ${{ job.status }} + fields: repo,message,commit,action,workflow,took + text: "PyPi Package: https://pypi.org/project/notificationapi-python-server-sdk" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_FAILED_WEBHOOK_URL }} + \ No newline at end of file From 9af9fbd09d03ca9a8534f17b9c162268250ef97a Mon Sep 17 00:00:00 2001 From: Danny Simms <103758200+GreyNewfie@users.noreply.github.com> Date: Wed, 22 Jan 2025 16:10:11 -0330 Subject: [PATCH 2/8] Update action versions Update actions to newest version since the version of actions/cache we were using was being deprecated. --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 982e8c8..dbc5451 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,9 +17,9 @@ jobs: python-version: [ 3.7, 3.8, 3.9] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} @@ -53,9 +53,9 @@ jobs: needs: ci runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python 3.9 - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: 3.9 From 7948927ff57c2129defbd0f280b1d48f38a31121 Mon Sep 17 00:00:00 2001 From: Danny Simms <103758200+GreyNewfie@users.noreply.github.com> Date: Wed, 22 Jan 2025 16:19:18 -0330 Subject: [PATCH 3/8] Update version in pullRequest.yml Upddate actions version in pullRequest workflow to match ci workflow --- .github/workflows/pullRequest.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pullRequest.yml b/.github/workflows/pullRequest.yml index b4b03f9..4ec93ba 100644 --- a/.github/workflows/pullRequest.yml +++ b/.github/workflows/pullRequest.yml @@ -17,9 +17,9 @@ jobs: python-version: [ 3.7, 3.8, 3.9] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} From 36dfcc6f5b4b06514d9ad929bb44e7f146a2b1e1 Mon Sep 17 00:00:00 2001 From: Danny Simms <103758200+GreyNewfie@users.noreply.github.com> Date: Wed, 22 Jan 2025 16:29:28 -0330 Subject: [PATCH 4/8] Revert to actions/setup-python@v2 Revert versions to test what's causing jobs error --- .github/workflows/ci.yml | 4 ++-- .github/workflows/pullRequest.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dbc5451..ce95785 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} @@ -55,7 +55,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Set up Python 3.9 - uses: actions/setup-python@v5 + uses: actions/setup-python@v2 with: python-version: 3.9 diff --git a/.github/workflows/pullRequest.yml b/.github/workflows/pullRequest.yml index 4ec93ba..4c09f9d 100644 --- a/.github/workflows/pullRequest.yml +++ b/.github/workflows/pullRequest.yml @@ -19,7 +19,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} From 1bff6232cb23af414055029ae75a83213dcb4c5c Mon Sep 17 00:00:00 2001 From: Danny Simms <103758200+GreyNewfie@users.noreply.github.com> Date: Wed, 22 Jan 2025 16:37:34 -0330 Subject: [PATCH 5/8] Revert GitHub actions version Revert GitHub actions to previous version to troubleshoot job error. --- .github/workflows/ci.yml | 4 ++-- .github/workflows/pullRequest.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ce95785..982e8c8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,7 @@ jobs: python-version: [ 3.7, 3.8, 3.9] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: @@ -53,7 +53,7 @@ jobs: needs: ci runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v2 - name: Set up Python 3.9 uses: actions/setup-python@v2 with: diff --git a/.github/workflows/pullRequest.yml b/.github/workflows/pullRequest.yml index 4c09f9d..b4b03f9 100644 --- a/.github/workflows/pullRequest.yml +++ b/.github/workflows/pullRequest.yml @@ -17,7 +17,7 @@ jobs: python-version: [ 3.7, 3.8, 3.9] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: From 3df95f9cb7eaccb4f473da0d938fb9c0797659d2 Mon Sep 17 00:00:00 2001 From: Danny Simms <103758200+GreyNewfie@users.noreply.github.com> Date: Wed, 22 Jan 2025 16:39:52 -0330 Subject: [PATCH 6/8] Modify Python versions Change Python 3.7 to 3.7.1 --- .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 982e8c8..c951f36 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [ 3.7, 3.8, 3.9] + python-version: [ 3.7.1, 3.8, 3.9] steps: - uses: actions/checkout@v2 From 354b162ff53768b96f45eb6f35ed9e09e691d3b7 Mon Sep 17 00:00:00 2001 From: Danny Simms <103758200+GreyNewfie@users.noreply.github.com> Date: Wed, 22 Jan 2025 16:58:43 -0330 Subject: [PATCH 7/8] Specify Ubuntu version Set Ubuntu version to work with Python 3.7 --- .github/workflows/ci.yml | 4 ++-- .github/workflows/pullRequest.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c951f36..c092343 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,10 +11,10 @@ on: jobs: ci: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 strategy: matrix: - python-version: [ 3.7.1, 3.8, 3.9] + python-version: [ 3.7, 3.8, 3.9] steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/pullRequest.yml b/.github/workflows/pullRequest.yml index b4b03f9..3671802 100644 --- a/.github/workflows/pullRequest.yml +++ b/.github/workflows/pullRequest.yml @@ -11,7 +11,7 @@ on: jobs: ci: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 strategy: matrix: python-version: [ 3.7, 3.8, 3.9] From 135ebf55adf3bbb6d55d829f5c3e63ea3d985ff6 Mon Sep 17 00:00:00 2001 From: Danny Simms <103758200+GreyNewfie@users.noreply.github.com> Date: Wed, 22 Jan 2025 17:08:55 -0330 Subject: [PATCH 8/8] Update versions for actions Update actions versions after setting Ubuntu version to be compatible with Python 3.7 --- .github/workflows/ci.yml | 11 ++++++----- .github/workflows/pullRequest.yml | 5 +++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c092343..aec16d5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,15 +11,16 @@ on: jobs: ci: - runs-on: ubuntu-22.04 + # Using 22.04 to be compatiable with Python 3.7 until it is deprecated + runs-on: ubuntu-22.04 strategy: matrix: python-version: [ 3.7, 3.8, 3.9] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} @@ -53,9 +54,9 @@ jobs: needs: ci runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python 3.9 - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: 3.9 diff --git a/.github/workflows/pullRequest.yml b/.github/workflows/pullRequest.yml index 3671802..7627e7d 100644 --- a/.github/workflows/pullRequest.yml +++ b/.github/workflows/pullRequest.yml @@ -11,15 +11,16 @@ on: jobs: ci: + # Using 22.04 to be compatiable with Python 3.7 until it is deprecated runs-on: ubuntu-22.04 strategy: matrix: python-version: [ 3.7, 3.8, 3.9] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }}