Update maven push package configuration
# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created
-# For more information see: https://github.com/actions/setup-java#apache-maven-with-a-settings-path
+# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path
name: Maven Package
@@ -13,42 +13,24 @@ jobs:
build:
runs-on: ubuntu-latest
+ permissions:
+ contents: read
+ packages: write
steps:
-
- uses: actions/checkout@v2
- - name: Set up JDK 1.8
- uses: actions/setup-java@v1
+ - name: Set up JDK
+ uses: actions/setup-java@v2
with:
- java-version: 1.8
-# server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
+ java-version: '8'
+ distribution: 'adopt'
+ server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file
- server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
- server-username: OSSRH_USERNAME # env variable for username in deploy
- server-password: OSSRH_TOKEN # env variable for token in deploy
- gpg-private-key: ${{ secrets.GPG_SIGNING_KEY }} # Value of the GPG private key to import
- gpg-passphrase: ${{ secrets.GPG_PASS_PHRASE }} # env variable for GPG private key passphrase
-
- name: Build with Maven
- run: mvn -B package -Dgpg.skip --file pom.xml
-
-# - name: Configure GPG Key
-# run: |
-# mkdir -p ~/.gnupg/
-# echo "$GPG_SIGNING_KEY" | base64 --decode > ~/.gnupg/private.key
-# gpg --import ~/.gnupg/private.key
-# env:
-# GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
+ run: mvn -B package --file pom.xml
- name: Publish to GitHub Packages Apache Maven
- run: mvn deploy -Dgpg.skip -s $GITHUB_WORKSPACE/settings.xml
+ run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml
env:
GITHUB_TOKEN: ${{ github.token }}
- OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
- OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
- GPG_PASS_PHRASE: ${ secrets.GPG_PASS_PHRASE }}
- GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
-
-
-
