Skip to content

Release SDK to Maven Central #81

Release SDK to Maven Central

Release SDK to Maven Central #81

Workflow file for this run

name: Release SDK to Maven Central
on:
workflow_dispatch:
# inputs:
# version:
# description: |
# The version to release.
# Add -SNAPSHOT to release a snapshot version.
# default: '0.0.1-SNAPSHOT'
jobs:
release-sdk:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: 11
distribution: 'temurin'
server-id: oss-sonatype
server-username: SONATYPE_USERNAME
server-password: SONATYPE_PASSWORD
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
# - name: Prepare Environment and Version
# id: prepare
# run: |
# git config user.name s-github-actions
# git config user.email [email protected]
# echo "branch_name=release/${{ inputs.version }}" >> $GITHUB_OUTPUT
# - name: Prepare Release
# id: prepare_release
# run: |
# cd code
# gradle --no-daemon versionsSet -Pversion=${{ inputs.version }}
#
# - name: Create PR
# uses: peter-evans/create-pull-request@v7
# with:
# branch: "publish-v${{ inputs.version }}"
# commit-message: "chore: prepare release ${{ inputs.version }}"
# title: "chore: Publish v${{ inputs.version }}"
# body: |
# This PR updates the version of the SDK to v`${{ inputs.version }}`.
# Generated by the EG SDK generator.
# add-paths: |
# code/*
- name: Publish
env:
GPG_PASSPHRASE: ${{ secrets.GPG_PRIVATE_KEY_PASSPHRASE }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
run: |
echo "Publishing version ${{ inputs.version }}"
cd code
gradle clean build publish -Psigning.gnupg.passphrase=$GPG_PASSPHRASE --no-daemon