Skip to content

Commit 943f37b

Browse files
committed
move to gradle instead of maven
1 parent 10543aa commit 943f37b

File tree

4 files changed

+122
-245
lines changed

4 files changed

+122
-245
lines changed

.github/snapshot.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Snapshot build & publish
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
8+
jobs:
9+
build:
10+
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v1
15+
- name: Set up JDK 1.8
16+
uses: actions/setup-java@v1
17+
with:
18+
java-version: 1.8
19+
- name: Gradle uploadArchives
20+
run: |
21+
./gradlew uploadArchives
22+
env:
23+
PGP_KEY: ${{ secrets.PGP_KEY }}
24+
PGP_PSW: ${{ secrets.PGP_PSW }}
25+
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
26+
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.2.0
1+
1.2.0-SNAPSHOT

build.gradle

Lines changed: 95 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,20 @@ plugins {
22
id 'java'
33
id 'java-library'
44
id 'maven-publish'
5+
id 'maven'
6+
id 'signing'
57
id 'org.unbroken-dome.test-sets' version '3.0.1'
68
}
79

810
group = 'net.twasi'
911
version = rootProject.file('VERSION').text.trim()
12+
archivesBaseName = rootProject.name
1013

1114
java.sourceCompatibility = JavaVersion.VERSION_1_8
1215

1316
repositories {
1417
mavenLocal()
18+
jcenter()
1519
maven {
1620
url = uri('https://repo.maven.apache.org/maven2/')
1721
}
@@ -45,10 +49,97 @@ integrationTest {
4549
useJUnitPlatform()
4650
}
4751

48-
publishing {
49-
publications {
50-
maven(MavenPublication) {
51-
from(components.java)
52+
task javadocJar(type: Jar) {
53+
classifier = 'javadoc'
54+
from javadoc
55+
}
56+
57+
artifacts {
58+
archives javadocJar, sourcesJar
59+
}
60+
61+
signing {
62+
def signingKey = System.getenv('PGP_KEY').replace("\\n", "\n")
63+
def signingPassword = System.getenv('PGP_PSW')
64+
65+
println(signingKey)
66+
67+
useInMemoryPgpKeys(signingKey, signingPassword)
68+
69+
sign configurations.archives
70+
}
71+
72+
def pomConfig = {
73+
licenses {
74+
license {
75+
name 'MIT'
76+
url 'https://opensource.org/licenses/MIT'
77+
distribution 'repo'
78+
}
79+
}
80+
developers {
81+
developer {
82+
name 'Lars Bärtschi'
83+
84+
}
85+
developer {
86+
name 'Merlin Westphal'
87+
88+
}
89+
}
90+
91+
scm {
92+
url 'https://github.com/Twasi/obs-websocket-java'
93+
}
94+
}
95+
96+
def ossrhUsername = System.getenv('OSSRH_USERNAME')
97+
def ossrhPassword = System.getenv('OSSRH_PASSWORD')
98+
99+
uploadArchives {
100+
repositories {
101+
mavenDeployer {
102+
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
103+
104+
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
105+
authentication(userName: ossrhUsername, password: ossrhPassword)
106+
}
107+
108+
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
109+
authentication(userName: ossrhUsername, password: ossrhPassword)
110+
}
111+
112+
pom.project {
113+
name 'websocket-obs-java'
114+
packaging 'jar'
115+
// optionally artifactId can be defined here
116+
description 'Library to connect to the OBS WebSocket interface.'
117+
url 'https://github.com/Twasi/obs-websocket-java'
118+
119+
scm {
120+
connection 'scm:git:git://github.com/Twasi/obs-websocket-java.git'
121+
developerConnection 'scm:git:[email protected]:Twasi/obs-websocket-java.git'
122+
url 'https://github.com/Twasi/obs-websocket-java'
123+
}
124+
125+
licenses {
126+
license {
127+
name 'MIT'
128+
url 'https://opensource.org/licenses/MIT'
129+
}
130+
}
131+
132+
developers {
133+
developer {
134+
name 'Lars Bärtschi'
135+
136+
}
137+
developer {
138+
name 'Merlin Westphal'
139+
140+
}
141+
}
142+
}
52143
}
53144
}
54145
}

pom.xml

Lines changed: 0 additions & 240 deletions
This file was deleted.

0 commit comments

Comments
 (0)