Skip to content

Commit b03964f

Browse files
committed
chore: added slack notification
Signed-off-by: Sridhar G K <gksridhar09@gmail.com>
1 parent df2b516 commit b03964f

File tree

2 files changed

+44
-1
lines changed

2 files changed

+44
-1
lines changed

.github/workflows/build-release.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,17 @@ jobs:
4747
contents: write
4848

4949
steps:
50+
- name: Notify Slack - Release Started
51+
run: |
52+
curl -X POST "${{ secrets.SLACK_RELEASE_WEBHOOK_URL }}" \
53+
-H 'Content-Type: application/json' \
54+
-d '{
55+
"sdk": "networking-python-sdk",
56+
"language": "python",
57+
"status": "started",
58+
"actor": "${{ github.actor }}"
59+
}'
60+
5061
- name: Checkout repository
5162
uses: actions/checkout@v4
5263
with:
@@ -87,3 +98,36 @@ jobs:
8798
run: |
8899
python -m build
89100
python -m twine upload dist/*
101+
102+
- name: Get package version
103+
if: success()
104+
id: get_version
105+
run: |
106+
VERSION=$(python -c "from ibm_cloud_networking_services.version import __version__; print(__version__)")
107+
echo "version=$VERSION" >> $GITHUB_OUTPUT
108+
109+
- name: Notify Slack - Release Completed
110+
if: success()
111+
run: |
112+
curl -X POST "${{ secrets.SLACK_PYPI_WEBHOOK_URL }}" \
113+
-H 'Content-Type: application/json' \
114+
-d '{
115+
"version": "${{ steps.get_version.outputs.version }}",
116+
"package_name": "ibm-cloud-networking-services",
117+
"pypi_url": "https://pypi.org/project/ibm-cloud-networking-services/${{ steps.get_version.outputs.version }}/",
118+
"github_release": "${{ github.server_url }}/${{ github.repository }}/releases/tag/v${{ steps.get_version.outputs.version }}",
119+
"commit_sha": "${{ github.sha }}",
120+
"actor": "${{ github.actor }}"
121+
}'
122+
123+
- name: Notify Slack - Release Failed
124+
if: failure()
125+
run: |
126+
curl -X POST "${{ secrets.SLACK_RELEASE_WEBHOOK_URL }}" \
127+
-H 'Content-Type: application/json' \
128+
-d '{
129+
"sdk": "networking-python-sdk",
130+
"language": "python",
131+
"status": "failed",
132+
"actor": "${{ github.actor }}"
133+
}'

package-lock.json

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)