diff --git a/.github/workflows/publish-libraries.yml b/.github/workflows/publish-libraries.yml index 64eb8108dd..e8b41a7ca3 100644 --- a/.github/workflows/publish-libraries.yml +++ b/.github/workflows/publish-libraries.yml @@ -18,15 +18,27 @@ on: # The data type of the input type: string -# A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - # This workflow contains a single job called "greet" - greet: - # The type of runner that the job will run on + publish: runs-on: ubuntu-latest - # Steps represent a sequence of tasks that will be executed as part of the job steps: - # Runs a single command using the runners shell - - name: Send greeting - run: echo "Hello ${{ inputs.name }}" \ No newline at end of file + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + + - name: Set Up JDK + uses: actions/setup-java@v3 + with: + distribution: 'zulu' # See 'Supported distributions' for available options + java-version: '17' + cache: 'gradle' + + - name: Change wrapper permissions + run: chmod +x ./gradlew + + # Create publish to maven + - name: Publish to maven + run: ./gradlew publishAllPublicationsToSonatypeRepository + env: + OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} + OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/maven-publish-conventions.gradle.kts b/buildSrc/src/main/kotlin/maven-publish-conventions.gradle.kts index a687b4ce81..906cde7f3d 100644 --- a/buildSrc/src/main/kotlin/maven-publish-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/maven-publish-conventions.gradle.kts @@ -29,11 +29,11 @@ val releaseRepositoryUrl: String = "https://oss.sonatype.org/service/local/stagi val snapshotRepositoryUrl: String = "https://oss.sonatype.org/content/repositories/snapshots/" fun getRepositoryUsername(): String? { - return System.getenv("NEXUS_USERNAME") + return System.getenv("OSSRH_USERNAME") } fun getRepositoryPassword(): String? { - return System.getenv("NEXUS_PASSWORD") + return System.getenv("OSSRH_PASSWORD") } afterEvaluate {