Release #54
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 | |
| on: | |
| release: | |
| types: [ published ] | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Import GPG key | |
| run: | | |
| echo "${{ secrets.MAVEN_GPG_PRIVATE_KEY }}" | gpg --batch --import | |
| echo 'pinentry-mode loopback' >> ~/.gnupg/gpg.conf | |
| - name: Extract version from pom.xml | |
| id: get_version | |
| run: | | |
| version=$(xmllint --xpath "/*[local-name()='project']/*[local-name()='version']/text()" auto-generated-sdk/pom.xml) | |
| echo "version=$version" >> $GITHUB_OUTPUT | |
| if [[ "$version" == *SNAPSHOT* ]]; then | |
| echo "is_snapshot=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "is_snapshot=false" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Set up JDK for snapshot repository | |
| if: steps.get_version.outputs.is_snapshot == 'true' | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '8' | |
| distribution: 'temurin' | |
| server-id: central-portal-snapshots | |
| server-username: MAVEN_PORTAL_USERNAME | |
| server-password: MAVEN_CENTRAL_TOKEN | |
| gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} | |
| gpg-passphrase: MAVEN_GPG_PASSPHRASE | |
| - name: Set up JDK for release repository | |
| if: steps.get_version.outputs.is_snapshot == 'false' | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '8' | |
| distribution: 'temurin' | |
| server-id: central | |
| server-username: MAVEN_PORTAL_USERNAME | |
| server-password: MAVEN_CENTRAL_TOKEN | |
| gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} | |
| gpg-passphrase: MAVEN_GPG_PASSPHRASE | |
| # - name: Set up JDK | |
| # if: steps.get_version.outputs.is_snapshot == 'true' | |
| # uses: actions/setup-java@v4 | |
| # with: | |
| # java-version: '8' | |
| # distribution: 'temurin' | |
| # server-id: central # Value of the distributionManagement/repository/id field of the pom.xml | |
| # server-username: MAVEN_PORTAL_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: Build with Maven | |
| run: mvn -B package --file auto-generated-sdk/pom.xml | |
| - name: Publish to Apache Maven Central | |
| run: cd auto-generated-sdk && mvn -Psign-artifacts verify deploy | |
| env: | |
| MAVEN_PORTAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} | |
| MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} | |
| MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} |