aboutsummaryrefslogtreecommitdiffstats
path: root/.github/workflows/release.yml
blob: adedea805769ba71707449893b607391135d2e10 (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
44
45
46
47
48
49
50
51
name: Release
# This workflow is triggered when publishing a GitHub release
on:
  release:
    types:
    - published

jobs:
  release:
    permissions:
      id-token: write
      contents: write
    uses: SonarSource/gh-action_release/.github/workflows/main.yaml@28c15313f2bb2ee0cb67ba48cc008c2391851b81 # 5.0.1
    with:
      publishToBinaries: true
      mavenCentralSync: true
      slackChannel: sonarqube-build
  release_docker:
    permissions:
      id-token: write
    runs-on: ubuntu-latest
    name: Start Docker release process
    needs: release
    timeout-minutes: 60
    steps:
    - name: get secrets
      id: secrets
      uses: SonarSource/vault-action-wrapper@8e22afd670393ed80f489f5dbd517d09ea21d75b # 2.4.3-1
      with:
        secrets: |
          development/github/token/SonarSource-sonar-scanner-cli-release token | GITHUB_TOKEN_RELEASE;
          development/kv/data/slack token | SLACK_BOT_TOKEN;
    - name: Create Release for Docker Image
      id: create_release
      uses: softprops/action-gh-release@v1
      env:
        GITHUB_TOKEN: ${{ fromJSON(steps.secrets.outputs.vault).GITHUB_TOKEN_RELEASE }}
        GITHUB_REPOSITORY: SonarSource/sonar-scanner-cli-docker
      with:
        tag_name: ${{ github.event.release.tag_name }}
        body: Release containing ScannerCLI version ${{ github.event.release.tag_name }}
        draft: false
        prerelease: false
    - name: Notify failures on Slack
      uses: slackapi/slack-github-action@v1.23.0
      if: failure()
      with:
        channel-id: sonarqube-build
        slack-message: "Release failed, see the logs at https://github.com/{{ GITHUB_REPOSITORY }}/actions by {{ GITHUB_ACTOR }}"
      env:
        SLACK_BOT_TOKEN: ${{ fromJSON(steps.secrets.outputs.vault).SLACK_BOT_TOKEN }}