11
11
12
12
jobs :
13
13
ci :
14
- runs-on : ubuntu-latest
14
+ # Using 22.04 to be compatiable with Python 3.7 until it is deprecated
15
+ runs-on : ubuntu-22.04
15
16
strategy :
16
17
matrix :
17
18
python-version : [ 3.7, 3.8, 3.9]
18
19
19
20
steps :
20
- - uses : actions/checkout@v2
21
+ - uses : actions/checkout@v4
21
22
- name : Set up Python ${{ matrix.python-version }}
22
- uses : actions/setup-python@v2
23
+ uses : actions/setup-python@v4
23
24
with :
24
25
python-version : ${{ matrix.python-version }}
25
26
53
54
needs : ci
54
55
runs-on : ubuntu-latest
55
56
steps :
56
- - uses : actions/checkout@v2
57
+ - uses : actions/checkout@v4
57
58
- name : Set up Python 3.9
58
- uses : actions/setup-python@v2
59
+ uses : actions/setup-python@v4
59
60
with :
60
61
python-version : 3.9
61
62
@@ -71,14 +72,27 @@ jobs:
71
72
TWINE_USERNAME : " __token__"
72
73
TWINE_PASSWORD : ${{ secrets.PYPI_API_TOKEN }}
73
74
74
- - name : Send Slack notification
75
+ - name : Send Slack notification for success
76
+ if : success()
75
77
uses : 8398a7/action-slack@v3
76
78
with :
77
- author_name : Python Server SDK
78
- status : ${{ job.status }}
79
- fields : repo,job
80
- text : " PyPi Package: https://pypi.org/project/notificationapi-python-server-sdk"
79
+ author_name : Python Server SDK
80
+ status : ${{ job.status }}
81
+ fields : repo,message,commit,action,workflow,took
82
+ text : " PyPi Package: https://pypi.org/project/notificationapi-python-server-sdk"
81
83
env :
82
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
83
- SLACK_WEBHOOK_URL : ${{ secrets.SLACK_WEBHOOK_URL }}
84
- if : always()
84
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
85
+ SLACK_WEBHOOK_URL : ${{ secrets.SLACK_SUCCESS_WEBHOOK_URL }}
86
+
87
+ - name : Send Slack notification for failure or cancellation
88
+ if : failure() || cancelled()
89
+ uses : 8398a7/action-slack@v3
90
+ with :
91
+ author_name : Python Server SDK
92
+ status : ${{ job.status }}
93
+ fields : repo,message,commit,action,workflow,took
94
+ text : " PyPi Package: https://pypi.org/project/notificationapi-python-server-sdk"
95
+ env :
96
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
97
+ SLACK_WEBHOOK_URL : ${{ secrets.SLACK_FAILED_WEBHOOK_URL }}
98
+
0 commit comments