Skip to content

Commit e565ffc

Browse files
authored
Merge pull request #8 from xenit-eu/ACC-1443
ACC-1443 Add publication step to CI
2 parents bc85d30 + c617356 commit e565ffc

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

.github/workflows/ci.yml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
build:
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: actions/checkout@v4
10+
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
1111
with:
1212
fetch-depth: 0
1313
- uses: actions/setup-java@v4
@@ -22,4 +22,24 @@ jobs:
2222
if: env.SONAR_TOKEN != null
2323
env:
2424
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
25+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
26+
publish:
27+
needs:
28+
- build
29+
if: ${{ github.ref == 'refs/heads/main' || startswith(github.ref, 'refs/tags/') }}
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
33+
with:
34+
fetch-depth: 0
35+
- uses: actions/setup-java@v4
36+
with:
37+
java-version: 17
38+
distribution: temurin
39+
- name: Publish
40+
env:
41+
SIGNING_PRIVATE_KEY: ${{ secrets.MAVEN_CENTRAL_GPG_KEY }}
42+
SIGNING_PASSWORD: ${{ secrets.MAVEN_CENTRAL_GPG_PASSWORD }}
43+
ORG_GRADLE_PROJECT_sonatype_username: ${{ secrets.SONATYPE_S01_USERNAME }}
44+
ORG_GRADLE_PROJECT_sonatype_password: ${{ secrets.SONATYPE_S01_PASSWORD }}
45+
run: ./gradlew publish

0 commit comments

Comments
 (0)