Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parametrized publish in gradle build #7563

Merged
merged 1 commit into from
Mar 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/merge-v4.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ jobs:
OSSRH_GPG_KEYID: ${{ secrets.OSSRH_GPG_KEYID }}
OSSRH_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_PASSPHRASE }}
OSSRH_GPG_PRIVATE_KEY: ${{ secrets.OSSRH_GPG_PRIVATE_KEY }}
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
ORG_GRADLE_PROJECT_mavenRepoPass: ${{ secrets.OSSRH_TOKEN }}
ORG_GRADLE_PROJECT_mavenRepoUser: ${{ secrets.OSSRH_USERNAME }}
# In other cases just build but don't publish
- name: build (no publish to maven central)
if: ${{ github.ref != 'refs/heads/main'}}
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/release-v4.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,9 @@ jobs:
OSSRH_GPG_KEYID: ${{ secrets.OSSRH_GPG_KEYID }}
OSSRH_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_PASSPHRASE }}
OSSRH_GPG_PRIVATE_KEY: ${{ secrets.OSSRH_GPG_PRIVATE_KEY }}
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
ORG_GRADLE_PROJECT_mavenRepoUrl: https://oss.sonatype.org/service/local/staging/deploy/maven2
ORG_GRADLE_PROJECT_mavenRepoPass: ${{ secrets.OSSRH_TOKEN }}
ORG_GRADLE_PROJECT_mavenRepoUser: ${{ secrets.OSSRH_USERNAME }}
# QEMU is needed for ARM64 build for egeria-configure
# egeria-configure needs to install utilities
- name: Set up QEMU
Expand Down
10 changes: 4 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,12 @@ subprojects {
// Secrets for credentials
repositories {
maven {
name = 'OSSRH'
def releasesRepoUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2'
def snapshotsRepoUrl = 'https://oss.sonatype.org/content/repositories/snapshots'
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
name = mavenRepoName
url = mavenRepoUrl
// User token (under profile) on oss.sonatype.org
credentials {
username = System.getenv("OSSRH_USERNAME")
password = System.getenv("OSSRH_TOKEN")
username = mavenRepoUser
password = mavenRepoPass
}
}
}
Expand Down
14 changes: 14 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,17 @@ org.gradle.priority=low

# Timeout the daemon after an hour
org.gradle.daemon.idletimeout=3600000

# Maven publish repository name
mavenRepoName=OSSRH

# Maven publish repository url
# it can be overriden by env variable ORG_GRADLE_PROJECT_mavenRepoUrl
mavenRepoUrl=https://oss.sonatype.org/content/repositories/snapshots

# Maven publish repository user
# it can be overriden by env variable ORG_GRADLE_PROJECT_mavenRepoUser
mavenRepoUser=
# Maven publish repository password
# it can be overriden by env variable ORG_GRADLE_PROJECT_mavenRepoPass
mavenRepoPass=