|
11 | 11 | runs-on: ubuntu-latest |
12 | 12 | name: Publish to PyPI |
13 | 13 |
|
| 14 | + outputs: |
| 15 | + published: ${{ steps.set-published-state.outputs.published }} # Define an output for the job |
| 16 | + |
14 | 17 | steps: |
15 | 18 | - name: Checkout |
16 | 19 | id: checkout |
@@ -43,40 +46,49 @@ jobs: |
43 | 46 | for target in $changed_targets; do |
44 | 47 | pants publish $target:: |
45 | 48 | done |
| 49 | + echo "published=true" >> $GITHUB_ENV |
46 | 50 | else |
47 | 51 | echo "No changes detected, skipping publish" |
| 52 | + echo "published=false" >> $GITHUB_ENV |
48 | 53 | fi |
49 | 54 | env: |
50 | 55 | TWINE_USERNAME: __token__ |
51 | 56 | TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} |
52 | 57 |
|
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 | + |
| 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