|
47 | 47 | contents: write |
48 | 48 |
|
49 | 49 | 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 | +
|
50 | 61 | - name: Checkout repository |
51 | 62 | uses: actions/checkout@v4 |
52 | 63 | with: |
|
87 | 98 | run: | |
88 | 99 | python -m build |
89 | 100 | 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 | + }' |
0 commit comments