File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3838 distribution : temurin
3939 java-version : " 21"
4040 cache : maven
41- server-id : central
42- server-username : MAVEN_CENTRAL_USERNAME
43- server-password : MAVEN_CENTRAL_PASSWORD
44- env :
45- MAVEN_CENTRAL_USERNAME : ${{ secrets.MAVEN_CENTRAL_USERNAME }}
46- MAVEN_CENTRAL_PASSWORD : ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
4741
4842 - name : Validate release secrets
4943 env :
6357 exit 1
6458 fi
6559
60+ - name : Write Maven settings.xml
61+ env :
62+ MAVEN_CENTRAL_USERNAME : ${{ secrets.MAVEN_CENTRAL_USERNAME }}
63+ MAVEN_CENTRAL_PASSWORD : ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
64+ run : |
65+ mkdir -p "$HOME/.m2"
66+ cat > "$HOME/.m2/settings.xml" <<EOF
67+ <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
68+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
69+ xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd">
70+ <servers>
71+ <server>
72+ <id>central</id>
73+ <username>${MAVEN_CENTRAL_USERNAME}</username>
74+ <password>${MAVEN_CENTRAL_PASSWORD}</password>
75+ </server>
76+ </servers>
77+ </settings>
78+ EOF
79+
6680 - name : Import GPG key
6781 uses : crazy-max/ghaction-import-gpg@v6
6882 with :
7993 run : mvn -B verify
8094
8195 - name : Publish to Maven Central
82- run : mvn -B -Prelease -DskipTests deploy -Dgpg.passphrase="${MAVEN_GPG_PASSPHRASE}"
96+ run : mvn -s "$HOME/.m2/settings.xml" - B -Prelease -DskipTests -Dcentral.plugin.version=0.10.0 deploy -Dgpg.passphrase="${MAVEN_GPG_PASSPHRASE}"
8397 env :
8498 MAVEN_GPG_PASSPHRASE : ${{ secrets.MAVEN_GPG_PASSPHRASE }}
8599
You can’t perform that action at this time.
0 commit comments