-
Notifications
You must be signed in to change notification settings - Fork 9
45 lines (42 loc) · 1.61 KB
/
publish-release-on-merge.yml
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
name: Publish release to the Maven Central Repository
on:
push:
tags:
- '*-release'
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: tracing
run: |
echo "Ref = ${{ github.ref }}"
echo "Action = ${{ github.action }}"
echo "Event = ${{ github.event_name }}"
echo "Actor = ${{ github.actor }}"
echo "SHA = ${{ github.sha }}"
- uses: actions/checkout@v3
- name: Set up Maven Central Repository
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.SIGNING_SECRET }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
# Build & Publish steps are separated to isolate secrets from retry action code
- name: Build package
uses: nick-fields/retry@v2
with:
timeout_minutes: 15
max_attempts: 3
retry_wait_seconds: 600
command: mvn -Pjenkins-release -DskipTests package -e --file DataAccess/pom.xml
- name: Publish package
run: mvn -Pjenkins-release -Dgpg.passphrase=${{ secrets.SIGN_MODULES_PASSPHRASE }} -DskipTests -DstagingProgressTimeoutMinutes=20 clean deploy -e --file DataAccess/pom.xml
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USER_NAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASS }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.SIGN_MODULES_PASSPHRASE }}
MAVEN_GPG_KEY: ${{ secrets.SIGNING_SECRET }}