Skip to content

Commit

Permalink
Add publishAll task and update GitHub Actions workflow
Browse files Browse the repository at this point in the history
Implemented a new Gradle task `publishAll` to publish for all available versions by iterating through the list of versions. Updated the GitHub Actions workflow to use this new task, ensuring that all versions are published in a single workflow run.
  • Loading branch information
ThePandaOliver committed Aug 23, 2024
1 parent 07f0b39 commit 370c8f2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
run: chmod +x ./gradlew

- name: Publish to GitHub Packages
run: ./gradlew publish
run: ./gradlew publishAll
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_ACTOR: ${{ github.actor }}
Expand Down
12 changes: 12 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,18 @@ project.gradle.extra.properties.forEach { prop ->

writeBuildGradlePredefine(project.properties["availableVersions"] as List<String>, project.properties["versionIndex"] as Int)

tasks.register("publishAll") {
val availableVersions = project.properties["availableVersions"] as List<String>

availableVersions.forEach { version ->
doLast {
exec {
commandLine = listOf("./gradlew", "-PminecraftVersion=${version}", "publish")
}
}
}
}

// gradle.properties
val supportedModLoaders: String by project

Expand Down

0 comments on commit 370c8f2

Please sign in to comment.