Skip to content

Commit 5a84ce1

Browse files
committed
set published state
1 parent 253ad66 commit 5a84ce1

File tree

1 file changed

+42
-30
lines changed

1 file changed

+42
-30
lines changed

.github/workflows/release.yml

+42-30
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ jobs:
1111
runs-on: ubuntu-latest
1212
name: Publish to PyPI
1313

14+
outputs:
15+
published: ${{ steps.set-published-state.outputs.published }} # Define an output for the job
16+
1417
steps:
1518
- name: Checkout
1619
id: checkout
@@ -43,40 +46,49 @@ jobs:
4346
for target in $changed_targets; do
4447
pants publish $target::
4548
done
49+
echo "published=true" >> $GITHUB_ENV
4650
else
4751
echo "No changes detected, skipping publish"
52+
echo "published=false" >> $GITHUB_ENV
4853
fi
4954
env:
5055
TWINE_USERNAME: __token__
5156
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
5257

53-
# notify-release:
54-
# runs-on: ubuntu-latest
55-
# name: Notify Release
56-
# strategy:
57-
# matrix:
58-
# url: [SLACK_WEBHOOK_ASK_DEVREL_URL, SLACK_WEBHOOK_DEVREL_TOOLING_URL, SLACK_WEBHOOK_DEVREL_PRIVATE_URL]
59-
# steps:
60-
# - name: Send to slack channels
61-
# uses: slackapi/[email protected]
62-
# if: always()
63-
# continue-on-error: true
64-
# with:
65-
# webhook: ${{ secrets[matrix.url]}}
66-
# webhook-type: incoming-webhook
67-
# errors: true
68-
# payload: |
69-
# blocks:
70-
# - type: "header"
71-
# text:
72-
# type: "plain_text"
73-
# text: ":initial_external_notification_sent: :python: Version ${{ github.event.release.name }} of the Python SDK has been released"
74-
# - type: "section"
75-
# text:
76-
# type: "mrkdwn"
77-
# text: "${{ github.event.release.body }}"
78-
# - type: "divider"
79-
# - type: "section"
80-
# text:
81-
# type: "mrkdwn"
82-
# text: "You can view the full change log <${{github.event.release.html_url }}|here>"
58+
- name: Set published state
59+
id: set-published-state
60+
run: |
61+
echo "::set-output name=published::$published"
62+
63+
notify-release:
64+
runs-on: ubuntu-latest
65+
name: Notify Release
66+
needs: publish-package
67+
if: needs.publish-package.outputs.published == 'true'
68+
strategy:
69+
matrix:
70+
url: [SLACK_WEBHOOK_ASK_DEVREL_URL, SLACK_WEBHOOK_DEVREL_TOOLING_URL, SLACK_WEBHOOK_DEVREL_PRIVATE_URL]
71+
steps:
72+
- name: Send to slack channels
73+
uses: slackapi/[email protected]
74+
if: always()
75+
continue-on-error: true
76+
with:
77+
webhook: ${{ secrets[matrix.url]}}
78+
webhook-type: incoming-webhook
79+
errors: true
80+
payload: |
81+
blocks:
82+
- type: "header"
83+
text:
84+
type: "plain_text"
85+
text: ":initial_external_notification_sent: :python: Version ${{ github.event.release.name }} of the Python SDK has been released"
86+
- type: "section"
87+
text:
88+
type: "mrkdwn"
89+
text: "${{ github.event.release.body }}"
90+
- type: "divider"
91+
- type: "section"
92+
text:
93+
type: "mrkdwn"
94+
text: "You can view the full change log <${{github.event.release.html_url }}|here>"

0 commit comments

Comments
 (0)