Repository navigation
50 lines (42 loc) · 1.7 KB
/
Copy pathrelease.yml
File metadata and controls
50 lines (42 loc) · 1.7 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
name: Release
on:
push:
tags: [ "v*" ]
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "17"
cache: maven
# Writes a settings.xml server entry `central` using the env vars below,
# and imports the GPG key for signing.
server-id: central
server-username: CENTRAL_TOKEN_USERNAME
server-password: CENTRAL_TOKEN_PASSWORD
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
# Maven 3.10 writes maven-metadata-local.xml into the Central staging repo; Central then
# rejects the bundle ("content that does NOT have a .pom file"). Pin 3.9 until the
# central-publishing-maven-plugin handles it.
- name: Install Maven 3.9
run: |
curl -fsSL https://archive.apache.org/dist/maven/maven-3/3.9.11/binaries/apache-maven-3.9.11-bin.tar.gz | tar xz -C "$RUNNER_TEMP"
echo "$RUNNER_TEMP/apache-maven-3.9.11/bin" >> "$GITHUB_PATH"
- name: Run tests
run: mvn -B --no-transfer-progress -v && mvn -B --no-transfer-progress verify
- name: Publish to Maven Central
run: mvn -B --no-transfer-progress -Prelease -DskipTests deploy
env:
CENTRAL_TOKEN_USERNAME: ${{ secrets.CENTRAL_TOKEN_USERNAME }}
CENTRAL_TOKEN_PASSWORD: ${{ secrets.CENTRAL_TOKEN_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true