-
Notifications
You must be signed in to change notification settings - Fork 1
63 lines (56 loc) · 1.54 KB
/
snapshot-build.yaml
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
name: "Build - Snapshot"
on:
push:
branches-ignore:
- main
tags-ignore:
- '*'
pull_request:
branches:
- main
jobs:
snapshot_build:
name: Snapshot build and publish
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install gpg secret key
run: cat <(echo -e "${{ secrets.GPG_SECRET_KEY }}") | gpg --batch --import
- name: Set up Maven Central Repository
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
cache: 'maven'
- name: Cache local Maven repository
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Set up maven settings
uses: s4u/maven-settings-action@v2.8.0
with:
servers: |
[{
"id": "ossrh",
"username": "${{ secrets.OSSRH_USER_V2 }}",
"password": "${{ secrets.OSSRH_TOKEN_V2 }}"
},
{
"id": "gpg.passphrase",
"passphrase": "${{ secrets.GPG_SECRET_KEY_PASSWORD }}",
"configuration": {}
}]
- name: Upload snapshot
run: |
mvn \
--no-transfer-progress \
--batch-mode \
clean deploy