Skip to content

Commit 743cc44

Browse files
Add missing maven central sync action in release.yml (#126)
1 parent 3ccbf75 commit 743cc44

File tree

1 file changed

+43
-1
lines changed

1 file changed

+43
-1
lines changed

.github/workflows/release.yml

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,50 @@ jobs:
3333
# Put your action repo here
3434
uses: SonarSource/gh-action_release/main@v3
3535

36-
- name: Check outputs
36+
- name: Release action results
3737
if: always()
3838
run: |
3939
echo "${{ steps.lt_release.outputs.releasability }}"
4040
echo "${{ steps.lt_release.outputs.release }}"
41+
42+
maven-central-sync:
43+
runs-on: ubuntu-latest
44+
needs:
45+
- sonar_release
46+
steps:
47+
- name: Setup JFrog CLI
48+
uses: jfrog/setup-jfrog-cli@v1
49+
- name: JFrog config
50+
run: jfrog rt config repox --url https://repox.jfrog.io/artifactory/ --apikey $ARTIFACTORY_API_KEY --basic-auth-only
51+
env:
52+
ARTIFACTORY_API_KEY: ${{ secrets.ARTIFACTORY_API_KEY }}
53+
- name: Get the version
54+
id: get_version
55+
run: |
56+
IFS=. read major minor patch build <<< "${{ github.event.release.tag_name }}"
57+
echo ::set-output name=build::"${build}"
58+
- name: Create local repository directory
59+
id: local_repo
60+
run: echo ::set-output name=dir::"$(mktemp -d repo.XXXXXXXX)"
61+
- name: Download Artifacts
62+
uses: SonarSource/gh-action_release/download-build@v3
63+
with:
64+
build-number: ${{ steps.get_version.outputs.build }}
65+
local-repo-dir: ${{ steps.local_repo.outputs.dir }}
66+
- name: Maven Central Sync
67+
id: maven-central-sync
68+
continue-on-error: true
69+
uses: SonarSource/gh-action_release/maven-central-sync@v3
70+
with:
71+
local-repo-dir: ${{ steps.local_repo.outputs.dir }}
72+
env:
73+
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
74+
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
75+
- name: Notify on failure
76+
if: ${{ failure() || steps.maven-central-sync.outcome == 'failure' }}
77+
uses: 8398a7/action-slack@v3
78+
with:
79+
status: failure
80+
fields: repo,author,eventName
81+
env:
82+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_BUILD_WEBHOOK }}

0 commit comments

Comments
 (0)