Repository navigation
67 lines (55 loc) · 2.03 KB
/
Copy pathmaster.yml
File metadata and controls
67 lines (55 loc) · 2.03 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Produces and releases artifacts
permissions:
contents: read
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
name: Build and run tests
steps:
- name: Checkout code
uses: actions/checkout@v7.0.1
# Setup JDK and .m2/settings.xml
- name: Set up JDK
uses: actions/setup-java@v6.0.1
with:
java-version: 17
distribution: 'zulu'
cache: maven
server-id: central
server-username: OSS_CENTRAL_USERNAME # env variable for Maven Central
server-password: OSS_CENTRAL_PASSWORD # env variable for Maven Central
# Prepare
- name: Prepare Maven Wrapper
run: chmod +x ./mvnw
# Build
- name: Build with Maven
run: ./mvnw clean verify -U -B -T4 -ntp
# Get GPG private key into GPG
- name: Import GPG Owner Trust
run: echo "${{ secrets.GPG_OWNERTRUST }}" | base64 --decode | gpg --import-ownertrust
- name: Import GPG key
run: echo "${{ secrets.GPG_SECRET_KEYS }}" | base64 --decode | gpg --import --no-tty --batch --yes --always-trust
# Publish release
- name: Deploy a new release version to Maven Central
run: ./mvnw clean deploy -B -ntp -DskipTests -DskipExamples -Prelease -Dgpg.keyname="${{ secrets.GPG_KEYNAME }}" -DkeepStagingRepositoryOnCloseRuleFailure=true
env:
OSS_CENTRAL_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
OSS_CENTRAL_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
# For debugging if publication fails
# - name: Upload a Build Artifact
# if: ${{ always() }}
# uses: actions/upload-artifact@v7.0.2
# with:
# name: central-bundle
# path: target/central-publishing/central-bundle.zip
# if-no-files-found: warn
# retention-days: 1
- name: Upload coverage information
uses: codecov/codecov-action@v7.1.1
with:
token: ${{ secrets.CODECOV_TOKEN }}