build: cleanup publish #16
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: publish | |
| on: | |
| workflow_dispatch: | |
| workflow_call: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-java@v5 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| - name: build | |
| shell: bash | |
| run: ./gradlew build | |
| - name: list gpg keys | |
| shell: bash | |
| run: | | |
| gpg -K | |
| - name: import GPG private key | |
| shell: bash | |
| run: | | |
| echo "use-agent" >> ~/.gnupg/gpg.conf | |
| echo "pinentry-mode loopback" >> ~/.gnupg/gpg.conf | |
| echo -e "${{ secrets.GPG_PRIVATE_KEY }}" | gpg --import --batch | |
| for fpr in $(gpg --list-keys --with-colons | awk -F: '/fpr:/ {print $10}' | sort -u); | |
| do | |
| echo -e "5\\ny\\n" | gpg --batch --command-fd 0 --expert --edit-key $fpr trust; | |
| done | |
| - name: list gpg keys | |
| shell: bash | |
| run: | | |
| gpg -K | |
| - name: publish | |
| shell: bash | |
| env: | |
| ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.CENTRAL_SONATYPE_TOKEN_USERNAME }} | |
| ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.CENTRAL_SONATYPE_TOKEN_PASSWORD }} | |
| ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_PASSPHRASE }} | |
| run: ./gradlew publishToMavenCentral |