aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Rekveld <mark.rekveld@sonarsource.com>2020-10-02 14:42:15 +0200
committerGitHub <noreply@github.com>2020-10-02 14:42:15 +0200
commitd2cf5aa18eb9a1be08e22e481351120dece744d8 (patch)
treef1508848ee1d5342670e2cd106d053f2dd7dde13
parentc347e99a8b96cee0a14ed16e1cbd2e2fc65903b0 (diff)
downloadsonar-scanner-cli-d2cf5aa18eb9a1be08e22e481351120dece744d8.tar.gz
sonar-scanner-cli-d2cf5aa18eb9a1be08e22e481351120dece744d8.zip
SQSCANNER-68 - Automatically trigger docker release on new CLI release (#93)4.5.0.2216
-rw-r--r--.github/workflows/release.yml87
1 files changed, 63 insertions, 24 deletions
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 09d3d12..875f4a3 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -1,32 +1,71 @@
-name: sonar-release
-# This workflow is triggered when publishing a new github release
+name: Release
+# This workflow is triggered when publishing a GitHub release
on:
release:
types:
- - published
+ - published
+
+env:
+ PYTHONUNBUFFERED: 1
jobs:
- sonar_release:
+ release:
runs-on: ubuntu-latest
name: Start release process
+ timeout-minutes: 60
steps:
- - name: Checkout release action
- uses: actions/checkout@v2
- with:
- repository: SonarSource/gh-action_LT_release
-
- - name: Scanner release
- id: scanner_release
- with:
- distribute: true
- attach_artifacts_to_github_release: true
- 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.scanner_release.outputs.releasability }}"
- echo "${{ steps.scanner_release.outputs.release }}"
+ - name: Run release action
+ id: run_release
+ uses: SonarSource/gh-action_LT_release@v2
+ with:
+ distribute: true
+ publish_to_binaries: true
+ attach_artifacts_to_github_release: true
+ run_rules_cov: false
+ slack_channel: sonarqube-build
+ env:
+ ARTIFACTORY_API_KEY: ${{ secrets.ARTIFACTORY_API_KEY }}
+ BINTRAY_USER: ${{ secrets.BINTRAY_USER }}
+ BINTRAY_TOKEN: ${{ secrets.BINTRAY_TOKEN }}
+ BURGRX_USER: ${{ secrets.BURGRX_USER }}
+ BURGRX_PASSWORD: ${{ secrets.BURGRX_PASSWORD }}
+ CENTRAL_USER: ${{ secrets.CENTRAL_USER }}
+ CENTRAL_PASSWORD: ${{ secrets.CENTRAL_PASSWORD }}
+ CIRRUS_TOKEN: ${{ secrets.CIRRUS_TOKEN }}
+ GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
+ PATH_PREFIX: ${{ secrets.BINARIES_PATH_PREFIX }}
+ GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }}
+ RELEASE_SSH_USER: ${{ secrets.RELEASE_SSH_USER }}
+ RELEASE_SSH_KEY: ${{ secrets.RELEASE_SSH_KEY }}
+ SLACK_API_TOKEN: ${{secrets.SLACK_API_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: Create Release for Docker Image
+ id: create_release
+ uses: actions/create-release@v1
+ env:
+ GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }}
+ with:
+ tag_name: ${{ github.event.release.tag_name }}
+ release_name: ${{ github.event.release.tag_name }}
+ body: Release containing ScannerCLI version ${{ github.event.release.tag_name }}
+ draft: false
+ prerelease: false
+ repo: SonarSource/sonar-scanner-cli-docker
+ - 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 }}"