From 104d9f9a4fdef61141f7e2aa2da1bed9b96cc0d6 Mon Sep 17 00:00:00 2001 From: Andrea Guarino Date: Fri, 28 Feb 2020 14:17:06 +0100 Subject: [PATCH] Add release workflow --- .github/workflows/release.yml | 46 +++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000000..cfb7dccd3f --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,46 @@ +name: sonar-release +# This workflow is triggered when publishing a new github release +on: + release: + types: + - published + +env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + +jobs: + sonar_release: + runs-on: ubuntu-latest + name: Start release process + steps: + - name: Checkout release action + uses: actions/checkout@v2 + with: + repository: SonarSource/gh-action_LT_release + + - name: LT release + id: lt_release + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + # Put your action repo here + uses: SonarSource/gh-action_LT_release@master + + - name: Check outputs + if: always() + run: | + echo "${{ steps.lt_release.outputs.releasability }}" + echo "${{ steps.lt_release.outputs.release }}" + #slack notifications + - name: Notify success on Slack + uses: Ilshidur/action-slack@1.6.2 + env: + SLACK_OVERRIDE_MESSAGE: 'Release successful' + with: + args: 'Release successful' + - name: Notify failures on Slack + uses: Ilshidur/action-slack@1.6.2 + if: failure() + env: + SLACK_OVERRIDE_MESSAGE: 'Release failed, see the logs at https://github.com/SonarSource/sonar-python/actions' + with: + args: 'Fail to release'