34 lines (30 loc) · 1.36 KB
/
deploy-snapshot.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
# Deploy a Snapshot to Sonatype via GitHub Actions
name: Sonatype Snapshot Deploy
# Run this build on push to develop
on: push
jobs:
deploy-snapshot:
runs-on: ubuntu-latest
steps:
# https://github.com/actions/checkout
- name: Checkout codebase
uses: actions/checkout@v2
# https://github.com/actions/setup-java
# Sets up Java, preparing the settings.xml to deploy to Sonatype (Maven)
- name: Set up for deploy to Sonatype
uses: actions/setup-java@v2
with:
java-version: 11
distribution: adopt
server-id: sonatype-snapshots # Value of the distributionManagement/repository/id field of the pom.xml
server-username: SONATYPE_USERNAME # env variable for sonatype username
server-password: SONATYPE_PASSWORD # env variable for sonatype password
gpg-private-key: ${{ secrets.CODESIGN_GPG_KEY }} # Value of the GPG private key to import
gpg-passphrase: CODESIGN_GPG_PASSPHRASE # env variable for GPG private key passphrase
# Execute deployment to sonatype
- name: Publish to Sonatype
run: mvn deploy -DreleaseBuild -DskipTests --batch-mode
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
CODESIGN_GPG_PASSPHRASE: ${{ secrets.CODESIGN_GPG_PASSPHRASE }}