Skip to content

Commit

Permalink
Remove publishAll task and update CI for multi-version publishing
Browse files Browse the repository at this point in the history
Removed the custom `publishAll` Gradle task and adjusted the GitHub Actions workflow to handle multiple Minecraft versions using a matrix strategy. This streamlines the build process and leverages the provided versions directly within the CI configuration.
  • Loading branch information
ThePandaOliver committed Aug 23, 2024
1 parent ac77915 commit 117b604
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,17 @@ on:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
minecraft-version: [ "1.19.2", "1.20", "1.20.5", "1.21" ]

permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v4

- name: Set up JDK 22
uses: actions/setup-java@v4
with:
Expand All @@ -27,7 +33,7 @@ jobs:
run: chmod +x ./gradlew

- name: Publish to GitHub Packages
run: ./gradlew publishAll
run: ./gradlew -PminecraftVersion=${{ matrix.minecraft-version }} publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_ACTOR: ${{ github.actor }}
Expand Down
12 changes: 0 additions & 12 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,6 @@ 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 117b604

Please sign in to comment.