|
| 1 | +name: sonar-release |
| 2 | +# This workflow is triggered when publishing a new github release |
| 3 | +on: |
| 4 | + release: |
| 5 | + types: |
| 6 | + - published |
| 7 | + |
| 8 | +jobs: |
| 9 | + sonar_release: |
| 10 | + runs-on: ubuntu-latest |
| 11 | + name: Start release process |
| 12 | + steps: |
| 13 | + - name: Release |
| 14 | + id: release |
| 15 | + env: |
| 16 | + ARTIFACTORY_API_KEY: ${{ secrets.ARTIFACTORY_API_KEY }} |
| 17 | + BURGRX_USER: ${{ secrets.BURGRX_USER }} |
| 18 | + BURGRX_PASSWORD: ${{ secrets.BURGRX_PASSWORD }} |
| 19 | + CIRRUS_TOKEN: ${{ secrets.CIRRUS_TOKEN }} |
| 20 | + PATH_PREFIX: ${{ secrets.BINARIES_PATH_PREFIX }} |
| 21 | + GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }} |
| 22 | + RELEASE_SSH_USER: ${{ secrets.RELEASE_SSH_USER }} |
| 23 | + RELEASE_SSH_KEY: ${{ secrets.RELEASE_SSH_KEY }} |
| 24 | + SLACK_API_TOKEN: ${{secrets.SLACK_API_TOKEN }} |
| 25 | + uses: SonarSource/gh-action_release/main@master |
| 26 | + with: |
| 27 | + publish_to_binaries: true |
| 28 | + slack_channel: team-lang-phpy |
| 29 | + - name: Release action results |
| 30 | + if: always() |
| 31 | + run: | |
| 32 | + echo "${{ steps.lt_release.outputs.releasability }}" |
| 33 | + echo "${{ steps.lt_release.outputs.release }}" |
| 34 | +
|
| 35 | + maven-central-sync: |
| 36 | + runs-on: ubuntu-latest |
| 37 | + needs: |
| 38 | + - sonar_release |
| 39 | + steps: |
| 40 | + - name: Setup JFrog CLI |
| 41 | + uses: jfrog/setup-jfrog-cli@v1 |
| 42 | + - name: JFrog config |
| 43 | + run: jfrog rt config repox --url https://repox.jfrog.io/artifactory/ --apikey $ARTIFACTORY_API_KEY --basic-auth-only |
| 44 | + env: |
| 45 | + ARTIFACTORY_API_KEY: ${{ secrets.ARTIFACTORY_API_KEY }} |
| 46 | + - name: Get the version |
| 47 | + id: get_version |
| 48 | + run: | |
| 49 | + IFS=. read major minor patch build <<< "${{ github.event.release.tag_name }}" |
| 50 | + echo ::set-output name=build::"${build}" |
| 51 | + - name: Create local repository directory |
| 52 | + id: local_repo |
| 53 | + run: echo ::set-output name=dir::"$(mktemp -d repo.XXXXXXXX)" |
| 54 | + - name: Download Artifacts |
| 55 | + uses: SonarSource/gh-action_release/download-build@master |
| 56 | + with: |
| 57 | + build-number: ${{ steps.get_version.outputs.build }} |
| 58 | + local-repo-dir: ${{ steps.local_repo.outputs.dir }} |
| 59 | + - name: Maven Central Sync |
| 60 | + id: maven-central-sync |
| 61 | + continue-on-error: true |
| 62 | + uses: SonarSource/gh-action_release/maven-central-sync@master |
| 63 | + with: |
| 64 | + local-repo-dir: ${{ steps.local_repo.outputs.dir }} |
| 65 | + env: |
| 66 | + OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} |
| 67 | + OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} |
| 68 | + - name: Notify on failure |
| 69 | + if: ${{ failure() || steps.maven-central-sync.outcome == 'failure' }} |
| 70 | + uses: 8398a7/action-slack@v3 |
| 71 | + with: |
| 72 | + status: failure |
| 73 | + fields: repo,author,eventName |
| 74 | + env: |
| 75 | + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_BUILD_WEBHOOK }} |
0 commit comments