Merge pull request #326 from Vonage/slack-release-notifications #56
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release published | ||
| on: | ||
| release: | ||
| types: [published] | ||
| permissions: | ||
| actions: write | ||
| checks: write | ||
| contents: write | ||
| deployments: read | ||
| issues: write | ||
| discussions: write | ||
| packages: write | ||
| pages: write | ||
| pull-requests: write | ||
| security-events: write | ||
| statuses: write | ||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| with: | ||
| ref: ${{ github.event.release.target_commitish }} | ||
| - name: Set up Ruby | ||
| uses: ruby/setup-ruby@v1 | ||
| with: | ||
| ruby-version: 3.0 | ||
| - run: bundle install | ||
| - name: Set Credentials | ||
| run: | | ||
| mkdir -p $HOME/.gem | ||
| touch $HOME/.gem/credentials | ||
| chmod 0600 $HOME/.gem/credentials | ||
| printf -- "---\n:rubygems_api_key: ${RUBYGEMS_API_KEY}\n" > $HOME/.gem/credentials | ||
| env: | ||
| GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
| RUBYGEMS_API_KEY: ${{secrets.RUBYGEMS_API_KEY}} | ||
| - name: Publish Gem | ||
| run: rake publish_gem | ||
| notify-release: | ||
| runs-on: ubuntu-latest | ||
| name: Notify Release | ||
| strategy: | ||
| matrix: | ||
| url: [SLACK_WEBHOOK_ASK_DEVREL_URL, SLACK_WEBHOOK_DEVREL_TOOLING_URL, SLACK_WEBHOOK_DEVREL_PRIVATE_URL] | ||
| steps: | ||
| - name: Send to slack channels | ||
| uses: slackapi/slack-github-action@v2.0.0 | ||
| if: always(); | ||
| continue-on-error: true | ||
| with: | ||
| webhook: ${{ secrets[matrix.url]}} | ||
| webhook-type: incoming-webhook | ||
| errors: true | ||
| payload: | | ||
| blocks: | ||
| - type: "header" | ||
| text: | ||
| type: "plain_text" | ||
| text: ":initial_external_notification_sent: :ruby: Version ${{ github.event.release.name }} of the Ruby SDK has been released" | ||
| - type: "section" | ||
| text: | ||
| type: "mrkdwn" | ||
| text: "${{ github.event.release.body }}" | ||
| - type: "divider" | ||
| - type: "section" | ||
| text: | ||
| type: "mrkdwn" | ||
| text: "You can view the full change log <${{github.event.release.html_url }}|here>" | ||