aboutsummaryrefslogtreecommitdiffstats
path: root/.github/workflows/release.yml
blob: b0499e19ead49cc7ecc6a2b8e9bfc042028fab9a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: Release
# This workflow is triggered when publishing a GitHub release
on:
  release:
    types:
      - published

jobs:
  release:
    runs-on: ubuntu-latest
    name: Start release process
    steps:
      # Not sure why this is needed... Fixes issue with running the action.
      - name: Checkout release action
        uses: actions/checkout@v2
        with:
          repository: SonarSource/gh-action_LT_release
      - name: Run release action
        id: run_release
        uses: SonarSource/gh-action_LT_release@master
        with:
          distribute: true
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_ORG_TOKEN }}
      - name: Log outputs
        if: always()
        run: |
          echo "${{ steps.run_release.outputs.releasability }}"
          echo "${{ steps.run_release.outputs.release }}"
          echo "${{ steps.run_release.outputs.distribute_release }}"
      - name: Notify success on Slack
        uses: Ilshidur/action-slack@2.0.0
        env:
          SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
        with:
          args: "Release successful for {{ GITHUB_REPOSITORY }} by {{ GITHUB_ACTOR }}"
      - name: Notify failures on Slack
        uses: Ilshidur/action-slack@2.0.0
        if: failure()
        env:
          SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
        with:
          args: "Release failed, see the logs at https://github.com/{{ GITHUB_REPOSITORY }}/actions by {{ GITHUB_ACTOR }}"