File tree Expand file tree Collapse file tree 6 files changed +63
-25
lines changed
Expand file tree Collapse file tree 6 files changed +63
-25
lines changed Original file line number Diff line number Diff line change 1+ name : Publish Snapshots
2+
3+ on :
4+ push :
5+ branches :
6+ - " mdwairi/oauth-support"
7+ workflow_dispatch :
8+ inputs :
9+ branch :
10+ description : " Branch name to release snapshots from"
11+ required : true
12+
13+ jobs :
14+ publish :
15+ runs-on : ubuntu-latest
16+ steps :
17+ - name : Checkout repository
18+ uses : actions/checkout@v4
19+ with :
20+ ref : ${{ inputs.branch }}
21+
22+ - name : Set Up JDK
23+ uses : actions/setup-java@v3
24+ with :
25+ distribution : ' temurin'
26+ java-version : ' 17'
27+
28+ - name : Publish Snapshots
29+ env :
30+ GPG_PASSPHRASE : ${{ secrets.GPG_PRIVATE_KEY_PASSPHRASE }}
31+ GPG_SECRET : ${{ secrets.GPG_PRIVATE_KEY }}
32+ SONATYPE_USERNAME : ${{ secrets.SONATYPE_USERNAME }}
33+ SONATYPE_PASSWORD : ${{ secrets.SONATYPE_PASSWORD }}
34+ run : ./gradlew publishSnapshots
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ plugins {
1313group = project.property(" GROUP_ID" ) as String
1414
1515apply (" gradle-tasks/specs.gradle.kts" )
16+ apply (" $rootDir /gradle-tasks/snapshot.gradle" )
1617
1718allprojects {
1819 repositories {
Original file line number Diff line number Diff line change 1+ // Nexus publishing plugin relies on the root project version to determine which repository to use (releases | snapshots)
2+ // We're setting the root project to a dummy version (1.0.0-SNAPSHOT) to instruct the plugin to use the snapshot repo.
3+ // This version won't be published. The publishSnapshots task will publish submodules with the defined version in their gradle.properties
4+ gradle. taskGraph. whenReady { taskGraph ->
5+ if (taskGraph. hasTask(" :publishSnapshots" )) {
6+ rootProject. version = " 1.0.0-SNAPSHOT"
7+ println " 📌 Setting root project version to 1.0.0-SNAPSHOT for publishSnapshots task"
8+ }
9+ }
10+
11+ tasks. register(" publishSnapshots" ) {
12+ def snapshotModules = rootProject. subprojects. findAll { project ->
13+ project. version. toString(). contains(" -SNAPSHOT" ) && project. tasks. named(" publish" ) != null
14+ }
15+
16+ if (! snapshotModules. isEmpty()) {
17+ dependsOn snapshotModules. collect { " :${ it.name} :publish" }
18+ }
19+
20+ doLast {
21+ if (snapshotModules. isEmpty()) {
22+ println " ❌ No snapshot modules to publish."
23+ } else {
24+ println " 📦 Successfully published snapshots for: ${ snapshotModules*.name} "
25+ }
26+ }
27+ }
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -13,5 +13,4 @@ dependencies {
1313
1414apply (" $rootDir /gradle-tasks/publish.gradle.kts" )
1515apply (" $rootDir /gradle-tasks/signing.gradle.kts" )
16- apply (" $rootDir /gradle-tasks/snapshot.gradle.kts" )
1716apply (" $rootDir /gradle-tasks/sdk-properties.gradle.kts" )
Original file line number Diff line number Diff line change 11ARTIFACT_NAME =xap-sdk
22DESCRIPTION =The Expedia API Platform (XAP) SDK
33
4- VERSION =2.0.0-beta
4+ VERSION =2.0.0-SNAPSHOT
You can’t perform that action at this time.
0 commit comments