forked from anyproto/anytype-heart
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
60 lines (50 loc) · 1.68 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
apply plugin: 'maven-publish' // Apply this plugin at the top of your library build.gradle
apply plugin: "io.freefair.git-version"
def githubProperties = new Properties()
//githubProperties.load(new FileInputStream(rootProject.file("github.properties"))) //Set env variable GPR_USER & GPR_API_KEY if not adding a properties file
def getArtificatId = { ->
return System.getenv("MAVEN_ARTIFACT_ID")
}
def getArtifactName = { ->
return System.getenv("MAVEN_ARTIFACT_NAME")
}
def getArtifactVersion = { ->
return System.getenv("MAVEN_ARTIFACT_VERSION")
}
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "io.freefair.gradle:git-plugin:6.2.0"
}
}
publishing {
publications {
bar(MavenPublication) {
groupId 'io.anyproto' // Replace with group ID
artifactId getArtificatId()
artifact getArtifactName()
version getArtifactVersion()
}
}
repositories {
maven {
name = "GitHubPackages"
/** Configure path of your package repository on Github
** Replace GITHUB_USERID with your/organisation Github userID
** and REPOSITORY with the repository name on GitHub
*/
url = uri("https://maven.pkg.github.com/anyproto/anytype-heart")
credentials {
/** Create github.properties in root project folder file with
** gpr.usr=GITHUB_USER_ID & gpr.key=PERSONAL_ACCESS_TOKEN
** Set env variable GPR_USER & GPR_API_KEY if not adding a properties file**/
username = githubProperties['gpr.usr'] ?: System.getenv("GITHUB_USER")
password = githubProperties['gpr.key'] ?: System.getenv("GITHUB_TOKEN")
}
}
}
}