Skip to content

Commit 3a35527

Browse files
authored
Merge pull request #329 from webauthn4j/maven-cental-release-job
Add Maven Central release job
2 parents 38dc3b7 + 5a775ee commit 3a35527

File tree

2 files changed

+81
-0
lines changed

2 files changed

+81
-0
lines changed

.github/workflows/release.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
build:
10+
name: Build
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
java_version: [8]
15+
os: [windows-latest]
16+
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v1
20+
21+
- name: Set up JDK ${{ matrix.java_version }}
22+
uses: actions/setup-java@v1
23+
with:
24+
java-version: ${{ matrix.java_version }}
25+
26+
- name: Build with Gradle
27+
run: |
28+
./gradlew build javadoc asciidoc -PfailBuildOnCVSS=4
29+
30+
- name: Upload to bintray
31+
env:
32+
BINTRAY_USER: ${{ secrets.BINTRAY_USER }}
33+
BINTRAY_TOKEN: ${{ secrets.BINTRAY_TOKEN }}
34+
MAVEN_CENTRAL_USER: ${{ secrets.MAVEN_CENTRAL_USER }}
35+
MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
36+
run: |
37+
./gradlew bintrayUpload

build.gradle

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ configure(webAuthn4JSpringSecurityLibraryProjects) {
5757
apply plugin: 'java-library'
5858
apply plugin: 'jacoco'
5959
apply plugin: "maven-publish"
60+
apply plugin: 'com.jfrog.bintray'
6061
apply plugin: "com.jfrog.artifactory"
6162

6263
javadoc {
@@ -146,6 +147,20 @@ configure(webAuthn4JSpringSecurityLibraryProjects) {
146147
def mavenCentralUser = getVariable('MAVEN_CENTRAL_USER', 'mavenCentralUser')
147148
def mavenCentralPassword = getVariable('MAVEN_CENTRAL_PASSWORD', 'mavenCentralPassword')
148149

150+
task bintrayGpgSign(){
151+
group = "publishing"
152+
doLast{
153+
signArtifactsOnBintray(bintrayUser, bintrayToken);
154+
}
155+
}
156+
157+
task bintrayMavenCentralSync(){
158+
group = "publishing"
159+
doLast{
160+
syncMavenCentralToBintray(bintrayUser, bintrayToken);
161+
}
162+
}
163+
149164
artifactory {
150165
contextUrl = 'http://oss.jfrog.org/artifactory/simple/'
151166
publish {
@@ -164,6 +179,35 @@ configure(webAuthn4JSpringSecurityLibraryProjects) {
164179
skip = !"${webAuthn4JSpringSecurityVersion}".endsWith("-SNAPSHOT") // Publish only when it is SNAPSHOT release
165180
}
166181

182+
bintray {
183+
user = bintrayUser
184+
key = bintrayToken
185+
configurations = ['archives']
186+
publish = true
187+
dryRun = !("${webAuthn4JSpringSecurityVersion}".endsWith(".RELEASE")) // Publish only when it is RELEASE release
188+
publications = ['standard']
189+
pkg {
190+
userOrg = "webauthn4j"
191+
repo = "webauthn4j"
192+
name = project.name
193+
desc = project.description
194+
licenses = ['Apache-2.0']
195+
vcsUrl = githubUrl
196+
version {
197+
name = "${webAuthn4JSpringSecurityVersion}"
198+
released = new Date()
199+
vcsTag = "${webAuthn4JSpringSecurityVersion}"
200+
gpg {
201+
sign = true
202+
}
203+
//Optional configuration for Maven Central sync of the version
204+
mavenCentralSync {
205+
user = mavenCentralUser
206+
password = mavenCentralPassword
207+
}
208+
}
209+
}
210+
}
167211
}
168212

169213
configure(sampleAppProjects) {

0 commit comments

Comments
 (0)