File tree Expand file tree Collapse file tree 4 files changed +34
-32
lines changed Expand file tree Collapse file tree 4 files changed +34
-32
lines changed Original file line number Diff line number Diff line change
1
+ import org.gradle.api.Project
2
+ import org.gradle.api.artifacts.dsl.RepositoryHandler
3
+ import org.gradle.api.artifacts.repositories.MavenArtifactRepository
4
+
5
+ /* *
6
+ * Set up GitHub Packages Registry for a specific repository.
7
+ *
8
+ * To use this GPR locally, you need to set the `gpr.user` and `gpr.key` properties
9
+ * in your `~/.gradle/gradle.properties` file, for example:
10
+ * ```
11
+ * gpr.user=your-github-username
12
+ * gpr.key=your-github-token
13
+ * ```
14
+ * Note: token must have "packages: read" permissions.
15
+ *
16
+ * On CI, provide `GITHUB_ACTOR` and `GITHUB_TOKEN` environment variables.
17
+ */
18
+ fun RepositoryHandler.githubPackages (
19
+ project : Project ,
20
+ repo : String ,
21
+ setup : MavenArtifactRepository .() -> Unit = {},
22
+ ) = with (project) {
23
+ maven {
24
+ name = " GitHubPackages"
25
+ url = uri(" https://maven.pkg.github.com/$repo " )
26
+ credentials {
27
+ username = findProperty(" gpr.user" ) as String? ? : System .getenv(" USERNAME" )
28
+ password = findProperty(" gpr.key" ) as String? ? : System .getenv(" TOKEN" )
29
+ }
30
+ setup()
31
+ }
32
+ }
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -11,11 +11,10 @@ group = "org.usvm"
11
11
12
12
repositories {
13
13
mavenCentral()
14
+ githubPackages(project, " UnitTestBot/jacodb" )
14
15
maven(" https://jitpack.io" )
15
16
}
16
17
17
- setupJacodbGitHubPackagesRepository()
18
-
19
18
dependencies {
20
19
// Align versions of all Kotlin components
21
20
implementation(platform(kotlin(" bom" , Versions .kotlin)))
Original file line number Diff line number Diff line change @@ -28,11 +28,10 @@ tasks {
28
28
29
29
repositories {
30
30
mavenCentral()
31
+ githubPackages(project, " UnitTestBot/jacodb" )
31
32
maven(" https://jitpack.io" )
32
33
}
33
34
34
- setupJacodbGitHubPackagesRepository()
35
-
36
35
dependencies {
37
36
compileOnly(Libs .jacodb_api_jvm)
38
37
}
You can’t perform that action at this time.
0 commit comments