diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a82636cfac..fdc8e0c301 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,6 +10,8 @@ on: env: JAVA: 11 JAVA_DISTRIBUTION: zulu + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_ACTOR: ${{ github.actor }} jobs: ci-core: diff --git a/buildSrc/src/main/kotlin/Dependencies.kt b/buildSrc/src/main/kotlin/Dependencies.kt index 1e312d34fe..2268063dbc 100644 --- a/buildSrc/src/main/kotlin/Dependencies.kt +++ b/buildSrc/src/main/kotlin/Dependencies.kt @@ -6,7 +6,7 @@ object Versions { const val clikt = "5.0.0" const val detekt = "1.23.7" const val ini4j = "0.5.4" - const val jacodb = "5acbadfed0" + const val jacodb = "lipen-snapshot+a9f47fd3" const val juliet = "1.3.2" const val junit = "5.9.3" const val kotlin = "2.1.0" @@ -116,7 +116,8 @@ object Libs { ) // https://github.com/UnitTestBot/jacodb - private const val jacodbPackage = "com.github.UnitTestBot.jacodb" // use "org.jacodb" with includeBuild + // private const val jacodbPackage = "com.github.UnitTestBot.jacodb" // JitPack + private const val jacodbPackage = "org.jacodb" // GitHub Packages Registry val jacodb_core = dep( group = jacodbPackage, name = "jacodb-core", diff --git a/buildSrc/src/main/kotlin/GitHubPackages.kt b/buildSrc/src/main/kotlin/GitHubPackages.kt new file mode 100644 index 0000000000..2b865dacf2 --- /dev/null +++ b/buildSrc/src/main/kotlin/GitHubPackages.kt @@ -0,0 +1,32 @@ +import org.gradle.api.Project +import org.gradle.api.artifacts.dsl.RepositoryHandler +import org.gradle.api.artifacts.repositories.MavenArtifactRepository + +/** + * Set up GitHub Packages Registry for a specific repository. + * + * To use this GPR locally, you need to set the `gpr.user` and `gpr.key` properties + * in your `~/.gradle/gradle.properties` file, for example: + * ``` + * gpr.user=your-github-username + * gpr.key=your-github-token + * ``` + * Note: token must have "packages: read" permissions. + * + * On CI, provide `GITHUB_ACTOR` and `GITHUB_TOKEN` environment variables. + */ +fun RepositoryHandler.githubPackages( + project: Project, + repo: String, + setup: MavenArtifactRepository.() -> Unit = {}, +) = with(project) { + maven { + name = "GitHubPackages" + url = uri("https://maven.pkg.github.com/$repo") + credentials { + username = findProperty("gpr.user") as String? ?: System.getenv("GITHUB_ACTOR") + password = findProperty("gpr.key") as String? ?: System.getenv("GITHUB_TOKEN") + } + setup() + } +} diff --git a/buildSrc/src/main/kotlin/usvm.kotlin-conventions.gradle.kts b/buildSrc/src/main/kotlin/usvm.kotlin-conventions.gradle.kts index 1ae09d4c0e..eafdd3720d 100644 --- a/buildSrc/src/main/kotlin/usvm.kotlin-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/usvm.kotlin-conventions.gradle.kts @@ -11,6 +11,7 @@ group = "org.usvm" repositories { mavenCentral() + githubPackages(project, "UnitTestBot/jacodb") maven("https://jitpack.io") } diff --git a/usvm-jvm/usvm-jvm-api/build.gradle.kts b/usvm-jvm/usvm-jvm-api/build.gradle.kts index c65a6b634b..2352a7c6ad 100644 --- a/usvm-jvm/usvm-jvm-api/build.gradle.kts +++ b/usvm-jvm/usvm-jvm-api/build.gradle.kts @@ -28,6 +28,7 @@ tasks { repositories { mavenCentral() + githubPackages(project, "UnitTestBot/jacodb") maven("https://jitpack.io") }