release and push to central #10
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: release and push to central | |
| on: | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # Action/checkoutv3 checks out the repository | |
| - uses: actions/checkout@v3 | |
| - name: Set up JAVA | |
| uses: actions/setup-java@v3 | |
| with: # running setup-java overwrites the settings.xml | |
| # For building java version 8, required by JADE | |
| distribution: 'temurin' | |
| java-version: '8' | |
| - name: build artifact | |
| run: mvn clean package | |
| - name: Prepare for publishing to Mavencnetral | |
| uses: actions/setup-java@v3 | |
| with: # running setup-java again overwrites the settings.xml | |
| # java version needs to be 11, because it is required by sonatype plugin | |
| # https://github.com/actions/setup-java | |
| distribution: 'temurin' | |
| java-version: '11' | |
| server-id: central | |
| server-username: MAVEN_USERNAME # env variable for username in deploy | |
| server-password: MAVEN_CENTRAL_TOKEN # env variable for token in deploy | |
| gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import | |
| gpg-passphrase: MAVEN_GPG_PASSPHRASE | |
| - name: Publish to Apache Maven Central | |
| run: mvn clean deploy -P release | |
| env: | |
| # define the variables with its corresponding Github secrets | |
| MAVEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_UT_USER }} | |
| MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_UT_PSWD }} | |
| MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} |