|
5 | 5 | types: |
6 | 6 | - published |
7 | 7 |
|
8 | | -env: |
9 | | - PYTHONUNBUFFERED: 1 |
10 | | - |
11 | 8 | jobs: |
12 | 9 | run_release: |
13 | 10 | runs-on: ubuntu-latest |
14 | 11 | name: Start release process |
15 | 12 | timeout-minutes: 60 |
16 | | - steps: |
17 | | - - name: Configure AWS Credentials |
18 | | - uses: aws-actions/configure-aws-credentials@v1 |
19 | | - with: |
20 | | - aws-access-key-id: ${{ secrets.BINARIES_AWS_ACCESS_KEY_ID }} |
21 | | - aws-secret-access-key: ${{ secrets.BINARIES_AWS_SECRET_ACCESS_KEY }} |
22 | | - aws-region: ${{ secrets.BINARIES_AWS_REGION }} |
23 | | - - name: Run release action |
24 | | - id: run_release |
25 | | - uses: SonarSource/gh-action_release/main@v4 |
26 | | - with: |
27 | | - publish_to_binaries: true |
28 | | - attach_artifacts_to_github_release: false |
29 | | - run_rules_cov: false |
30 | | - slack_channel: sonarqube-build |
31 | | - env: |
32 | | - ARTIFACTORY_API_KEY: ${{ secrets.ARTIFACTORY_API_KEY }} |
33 | | - BINARIES_AWS_DEPLOY: ${{ secrets.BINARIES_AWS_DEPLOY }} |
34 | | - BURGRX_USER: ${{ secrets.BURGRX_USER }} |
35 | | - BURGRX_PASSWORD: ${{ secrets.BURGRX_PASSWORD }} |
36 | | - CIRRUS_TOKEN: ${{ secrets.CIRRUS_TOKEN }} |
37 | | - PATH_PREFIX: ${{ secrets.BINARIES_PATH_PREFIX }} |
38 | | - GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }} |
39 | | - RELEASE_SSH_USER: ${{ secrets.RELEASE_SSH_USER }} |
40 | | - RELEASE_SSH_KEY: ${{ secrets.RELEASE_SSH_KEY }} |
41 | | - SLACK_API_TOKEN: ${{secrets.SLACK_API_TOKEN }} |
42 | | - - name: Log outputs |
43 | | - if: always() |
44 | | - run: | |
45 | | - echo "${{ steps.run_release.outputs.releasability }}" |
46 | | - echo "${{ steps.run_release.outputs.release }}" |
47 | | - echo "${{ steps.run_release.outputs.distribute_release }}" |
48 | | - - name: Notify success on Slack |
49 | | - uses: Ilshidur/action-slack@2.0.0 |
50 | | - env: |
51 | | - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} |
52 | | - with: |
53 | | - args: "Release successful for {{ GITHUB_REPOSITORY }} by {{ GITHUB_ACTOR }}" |
54 | | - - name: Notify failures on Slack |
55 | | - uses: Ilshidur/action-slack@2.0.0 |
56 | | - if: failure() |
57 | | - env: |
58 | | - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} |
59 | | - with: |
60 | | - args: "Release failed, see the logs at https://github.com/{{ GITHUB_REPOSITORY }}/actions by {{ GITHUB_ACTOR }}" |
61 | | - maven-central-sync: |
62 | | - runs-on: ubuntu-latest |
63 | | - needs: |
64 | | - - run_release |
65 | | - steps: |
66 | | - - name: Setup JFrog CLI |
67 | | - uses: jfrog/setup-jfrog-cli@v1 |
68 | | - - name: JFrog config |
69 | | - run: jfrog rt config repox --url https://repox.jfrog.io/artifactory/ --apikey $ARTIFACTORY_API_KEY --basic-auth-only |
70 | | - env: |
71 | | - ARTIFACTORY_API_KEY: ${{ secrets.ARTIFACTORY_API_KEY }} |
72 | | - - name: Get the version |
73 | | - id: get_version |
74 | | - run: | |
75 | | - IFS=. read major minor patch build <<< "${{ github.event.release.tag_name }}" |
76 | | - echo ::set-output name=build::"${build}" |
77 | | - - name: Create local repository directory |
78 | | - id: local_repo |
79 | | - run: echo ::set-output name=dir::"$(mktemp -d repo.XXXXXXXX)" |
80 | | - - name: Download Artifacts |
81 | | - uses: SonarSource/gh-action_release/download-build@v4 |
82 | | - with: |
83 | | - build-number: ${{ steps.get_version.outputs.build }} |
84 | | - local-repo-dir: ${{ steps.local_repo.outputs.dir }} |
85 | | - - name: Maven Central Sync |
86 | | - id: maven-central-sync |
87 | | - continue-on-error: true |
88 | | - uses: SonarSource/gh-action_release/maven-central-sync@v4 |
89 | | - with: |
90 | | - local-repo-dir: ${{ steps.local_repo.outputs.dir }} |
91 | | - env: |
92 | | - OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} |
93 | | - OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} |
94 | | - - name: Notify on failure |
95 | | - if: ${{ failure() || steps.maven-central-sync.outcome == 'failure' }} |
96 | | - uses: 8398a7/action-slack@v3 |
97 | | - with: |
98 | | - status: failure |
99 | | - fields: repo,author,eventName |
100 | | - env: |
101 | | - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_BUILD_WEBHOOK }} |
102 | | - |
| 13 | + permissions: |
| 14 | + contents: read |
| 15 | + id-token: write |
| 16 | + uses: SonarSource/gh-action_release/.github/workflows/main.yaml@d42e8be3a9772d0447a7d2f3d2be31312b218383 # tag=5.0.1 |
| 17 | + with: |
| 18 | + publishToBinaries: true |
| 19 | + mavenCentralSync: true |
| 20 | + slackChannel: sonarqube-build |
0 commit comments