Skip to content

refactor: make a release pipeline for maven central #6

refactor: make a release pipeline for maven central

refactor: make a release pipeline for maven central #6

Workflow file for this run

name: Release Java SDK to Maven Central
on:
pull_request:
branches: ['main']
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: 'maven'
- name: Import GPG Key
uses: crazy-max/ghaction-import-gpg@v4
with:
gpg_private_key: KS0tES1CRUdJPiBQR1AgUFJJVkFURSBLOVkgQkxPQ0stLS0tLQoKbElZRVl0UXczQllKS3dZQkJBSGFSdzhCQVFkQUNhZFg5U1FFMTR4Snd2ODFsc0VCRnJMd0NPVUdzeFR3NGZyRwpkamxJSzFyK0J3TUNsQmoxUWlEUXg5cjdiWlRTYWVHSUtoeWZsZGFJdVk0V2FpSTMyb1hCRXI5eGlBeDArNWxUCmpJeVVqQU5RK0Q5TjBiRllJQlRkU2VRNGhrWUgzem1ZSEhhSU85T1dmdjlVMTl5dWtjS0cwN1FiYzJGeWRHaGgKYXlBOGMyRnlkR2hoYTBCclpYQnNiM2t1YVc4K2lKa0VFeFlLQUVFV0lRVDdvcTB3aEpPUGN0Z1RTMm9WY01PcAp0OUZhNmdVQ1l0UXczQUliQXdVSkE4Sm5BQVVMQ1FnSEFnSWlBZ1lWQ2drSUN3SUVGZ0lEQVFJZUJ3SVhnQUFLCkNSQVZjTU9wdDlGYTZ1clVBUUQrR0hlZU5BcE9oRzdhejJLU3gzZVlJNDRDV2ZjcHFQenZ5QmVUVzNuNGJRRUEKcWNFZjFuZ3ArVG9pamVSL2ZvMEYzamhsc3grcmhHOXZmTFFSNmNFWElnS2Npd1JpMUREY0Vnb3JCZ0VFQVpkVgpBUVVCQVFkQVkwNW9KRUs2WW50SlpPd2oyVjVsNnhyN2lta0wvcldDNkNwS2paK0U2dzhEQVFnSC9nY0RBdkZPCktWZUlBUS9TKzVKakZOaUxqYStpWW9RZC9xaXhLa29JQTVUNXB4Z05QWjNXU3pWa2VLdXNzcHRSZ0ZzVTJ6UW4KdEFHSEs5My9OdDFnQkNnekxBSDEwb1FPZnU1alVvWElzVGhOS3dXSWZnUVlGZ29BSmhZaEJQdWlyVENFazQ5eQoyQk5MYWhWd3c2bTMwVnJxQlFKaTFERGNBaHNNQlFrRHdtY0FBQW9KRUJWd3c2bTMwVnJxUVhNQkFMYTBHL3lBCk9aK3NoNUxDNSs5eW5EL09iMnZaMmVLNk5VTmpUY2hhNHFnZkFRQ3h2OWlnM3RGQkxQeWJDUUVuNGJhYlBRd2gKRWJEUFRCbXdDZE14dTZGbEJnPT0KPWlidUgKLS0tLS1FTkQgUEdQIFBSSVZBVEUgS0VZIEJMT0NLLS0tLS0S
passphrase: ${{ secrets.GPG_PASSPHRASE }}
# - name: Set Maven Version
# run: mvn versions:set -DnewVersion=${{ github.event.inputs.newVersion }}
# - name: Commit new version
# run: |
# git config --local user.email "action@github.com"
# git config --local user.name "GitHub Action"
# git commit -am "Update project version to ${{ github.event.inputs.newVersion }}"
# git push
- name: Deploy to Maven Central
run: mvn clean deploy -P release
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}