-
Notifications
You must be signed in to change notification settings - Fork 3
79 lines (71 loc) · 2.42 KB
/
release.yml
File metadata and controls
79 lines (71 loc) · 2.42 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
68
69
70
71
72
73
74
75
76
77
78
79
name: Release and Deploy to Maven Central
on:
push:
branches: ["master"]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: "21"
distribution: "temurin"
cache: maven
- name: Set up GPG
uses: crazy-max/ghaction-import-gpg@v5
with:
gpg_private_key: ${{ secrets.SETTINGS_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
- name: Configure Maven settings
run: |
mkdir -p ~/.m2
cat > ~/.m2/settings.xml << EOF
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>ossrh</id>
<username>${{ secrets.GPG_USERNAME }}</username>
<password>${{ secrets.GPG_PASSWORD }}</password>
</server>
<server>
<id>central</id>
<username>${{ secrets.GPG_USERNAME }}</username>
<password>${{ secrets.GPG_PASSWORD }}</password>
</server>
</servers>
<profiles>
<profile>
<id>gpg-signing</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<gpg.executable>gpg</gpg.executable>
<gpg.passphrase>${{ secrets.GPG_PASSPHRASE }}</gpg.passphrase>
</properties>
</profile>
</profiles>
</settings>
EOF
- name: Deploy to Maven Central
run: mvn -B clean deploy -P release
- name: Create GitHub Release
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "${{ github.ref_name }}"
prerelease: false
files: |
target/*.jar
target/*-sources.jar
target/*-javadoc.jar