Skip to content

Commit

Permalink
Refine plugin publishing tasks in Gradle build. (#128)
Browse files Browse the repository at this point in the history
This change separates plugin publishing tasks for snapshot and release builds, and pushes them to separate Toolbox Enterprise channels. It also updates the corresponding GitHub workflows accordingly. This provides more flexibility and control over plugin release processes.
  • Loading branch information
lamba92 authored Feb 29, 2024
1 parent 05e8e72 commit 17ae149
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,18 @@ jobs:
java-version: '17'
distribution: 'zulu'
- uses: gradle/gradle-build-action@v2
- name: Run :publishShadowPlugin task
run: ./gradlew :plugin:publishShadowPluginToMarketplace publishAllPublicationsToSpaceRepository
- name: Run :publishShadowPluginToMarketplace task
run: ./gradlew publishAllPublicationsToSpaceRepository :plugin:publishPluginToMarketplace
env:
MARKETPLACE_TOKEN: ${{ secrets.MARKETPLACE_TOKEN }}
GRADLE_ENTERPRISE_KEY: ${{ secrets.GRADLE_ENTERPRISE_KEY }}
MAVEN_SPACE_PASSWORD: ${{ secrets.MAVEN_SPACE_PASSWORD }}
MAVEN_SPACE_USERNAME: ${{ secrets.MAVEN_SPACE_USERNAME }}
CHANGE_NOTES: ${{ github.event.release.body }}
- name: Run :publishStablePluginToTBE task
run: ./gradlew :plugin:publishReleasePluginToTBE
env:
KMP: true
TOOLBOX_ENTERPRISE_TOKEN: ${{ secrets.TOOLBOX_ENTERPRISE_TOKEN }}
GRADLE_ENTERPRISE_KEY: ${{ secrets.GRADLE_ENTERPRISE_KEY }}
CHANGE_NOTES: ${{ github.event.release.body }}
2 changes: 1 addition & 1 deletion .github/workflows/publish-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
cache: gradle
- uses: gradle/gradle-build-action@v2
- name: Run :publishShadowPlugin task
run: ./gradlew :plugin:publishShadowPlugin publishAllPublicationsToSpaceRepository
run: ./gradlew :plugin:publishSnapshotPluginToTBE publishAllPublicationsToSpaceRepository
env:
TOOLBOX_ENTERPRISE_TOKEN: ${{ secrets.TOOLBOX_ENTERPRISE_TOKEN }}
GRADLE_ENTERPRISE_KEY: ${{ secrets.GRADLE_ENTERPRISE_KEY }}
Expand Down
16 changes: 13 additions & 3 deletions plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -138,17 +138,27 @@ tasks {
destinationDirectory = layout.buildDirectory.dir("distributions")
}

register<PublishPluginTask>("publishShadowPlugin") {
register<PublishPluginTask>("publishSnapshotPluginToTBE") {
group = "publishing"
distributionFile = buildShadowPlugin.flatMap { it.archiveFile }
toolboxEnterprise = true
host = "https://tbe.labs.jb.gg/"
token = project.properties["toolboxEnterpriseToken"]?.toString()
?: getenv("TOOLBOX_ENTERPRISE_TOKEN")
channels = listOf("Snapshots")
channels = listOf("Snapshot")
}

register<PublishPluginTask>("publishShadowPluginToMarketplace") {
register<PublishPluginTask>("publishReleasePluginToTBE") {
group = "publishing"
distributionFile = buildShadowPlugin.flatMap { it.archiveFile }
toolboxEnterprise = true
host = "https://tbe.labs.jb.gg/"
token = project.properties["toolboxEnterpriseToken"]?.toString()
?: getenv("TOOLBOX_ENTERPRISE_TOKEN")
channels = listOf("Release")
}

register<PublishPluginTask>("publishPluginToMarketplace") {
group = "publishing"
distributionFile = buildShadowPlugin.flatMap { it.archiveFile }
token = project.properties["marketplaceToken"]?.toString()
Expand Down

0 comments on commit 17ae149

Please sign in to comment.