diff --git a/.github/workflows/selfserve-release.yaml b/.github/workflows/selfserve-release.yaml new file mode 100644 index 000000000..9afd7c976 --- /dev/null +++ b/.github/workflows/selfserve-release.yaml @@ -0,0 +1,42 @@ +name: Release an SDK to Maven Central + +on: + workflow_call: + inputs: + sdk_key: + description: 'Key to the generated SDK artifact' + default: 'sdk' + type: string + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Set up JDK 21 + uses: actions/setup-java@v4 + with: + java-version: '21' + distribution: 'temurin' + server-id: oss-sonatype + server-username: SONATYPE_USERNAME + server-password: SONATYPE_PASSWORD + gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} + gpg-passphrase: GPG_PASSPHRASE + settings-path: ${{ github.workspace }} + + - name: Download SDK Artifact + uses: actions/download-artifact@v4 + with: + name: ${{ inputs.sdk_key }} + path: sdk + + - name: Release SDK + working-directory: sdk + env: + SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} + SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} + GPG_PASSPHRASE: ${{ secrets.GPG_PRIVATE_KEY_PASSPHRASE }} + run: | + echo "Starting SDK Release - version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" + mvn deploy --settings $GITHUB_WORKSPACE/settings.xml -B -U -P release -DskipTests=true + echo "SDK Released"