Skip to content

Commit

Permalink
set up environment keys
Browse files Browse the repository at this point in the history
  • Loading branch information
andresmr committed Mar 22, 2024
1 parent 5849915 commit 8daecfb
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 10 deletions.
28 changes: 20 additions & 8 deletions .github/workflows/publish-libraries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
# 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 }}
4 changes: 2 additions & 2 deletions buildSrc/src/main/kotlin/maven-publish-conventions.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 8daecfb

Please sign in to comment.