Skip to content

Commit

Permalink
[pinpoint-apm#8571] Add maven-central-deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
emeroad authored and emeroad committed Dec 30, 2021
1 parent 8318b5b commit 47ec8a2
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 26 deletions.
46 changes: 22 additions & 24 deletions .github/workflows/maven-central-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,39 +9,18 @@ on:
git-ref:
description: 'The branch, tag or SHA to checkout'
required: true
default: 'master'
default: 'v2.x.y or master'

jobs:
publish:
runs-on: ubuntu-20.04
steps:
- run: |
echo "Release branch: ${{ github.event.inputs.git-ref }}!"
echo "Release ref: ${{ github.event.inputs.git-ref }}"
- name : Git checkout
uses: actions/checkout@v2
with:
ref: ${{ github.event.inputs.git-ref }}
- name: Set up JDK 7
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '7'
- name: Set up JDK 8
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '8'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Set JAVA_HOME
run: |
echo "JAVA_7_HOME=$JAVA_HOME" >> $GITHUB_ENV
echo "JAVA_8_HOME=$JAVA_HOME_8_X64" >> $GITHUB_ENV
echo "JAVA_11_HOME=$JAVA_HOME_11_X64" >> $GITHUB_ENV
echo "JAVA_HOME=$JAVA_HOME_8_X64" >> $GITHUB_ENV
- name: Java Environment
run: env | grep '^JAVA'
- name: Cache Maven packages
uses: actions/cache@v2
with:
Expand All @@ -62,8 +41,27 @@ jobs:
key: ${{ runner.os }}-node_install-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-node_install-
- name: Set up JDK 7
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '7'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Set JAVA_HOME
run: |
echo "JAVA_7_HOME=$JAVA_HOME" >> $GITHUB_ENV
echo "JAVA_8_HOME=$JAVA_HOME_8_X64" >> $GITHUB_ENV
echo "JAVA_11_HOME=$JAVA_HOME_11_X64" >> $GITHUB_ENV
echo "JAVA_HOME=$JAVA_HOME_8_X64" >> $GITHUB_ENV
- name: Java Environment
run: env | grep '^JAVA'
- name: Publish package
run: ./mvnw --batch-mode -Pcode.coverage deploy --file pom.xml
run: ./mvnw --batch-mode deploy --file pom.xml -DskipTests=true -Pmaven.central.release
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
15 changes: 13 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1414,9 +1414,13 @@
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.2.0</version>
<version>3.3.1</version>
<configuration>
<additionalJOption>-Xdoclint:none</additionalJOption>
<!-- <detectOfflineLinks>false</detectOfflineLinks>-->
<!-- <detectJavaApiLink>false</detectJavaApiLink>-->
<!-- <source>8</source>-->
<javadocExecutable>${jdk.home}/bin/javadoc</javadocExecutable>
</configuration>
<executions>
<execution>
Expand All @@ -1430,7 +1434,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<version>3.0.1</version>
<executions>
<execution>
<id>sign-artifacts</id>
Expand All @@ -1440,6 +1444,13 @@
</goals>
</execution>
</executions>
<configuration>
<!-- This is necessary for gpg to not try to use the pinentry programs -->
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
Expand Down

0 comments on commit 47ec8a2

Please sign in to comment.