Skip to content
This repository was archived by the owner on May 26, 2023. It is now read-only.

Commit 1ddde36

Browse files
authored
Merge pull request #3 from app-outlet/maven-central-publishing
Maven central publishing
2 parents 2b8a180 + a3d6ccc commit 1ddde36

File tree

9 files changed

+103
-155
lines changed

9 files changed

+103
-155
lines changed

.github/workflows/gradle-publish.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@
55
# This workflow will build a package using Gradle and then publish it to GitHub packages when a release is created
66
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Publishing-using-gradle
77

8-
name: Gradle Package
8+
name: Package deployment
99

10-
on:
11-
- pull_request
10+
on: release
1211

1312
jobs:
1413
build:
@@ -25,10 +24,10 @@ jobs:
2524
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
2625
settings-path: ${{ github.workspace }} # location for the settings.xml file
2726

28-
- name: Build with Gradle
27+
- name: Application build
2928
run: ./gradlew build
3029

31-
- name: Publish to GitHub Packages
30+
- name: Publish to Maven package registry
3231
run: ./gradlew publish
3332
env:
3433
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}

.github/workflows/pull-request.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Package deployment
2+
3+
on: pull_request
4+
5+
jobs:
6+
build:
7+
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v3
12+
- name: Set up JDK 11
13+
uses: actions/setup-java@v3
14+
with:
15+
java-version: '11'
16+
distribution: 'temurin'
17+
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
18+
settings-path: ${{ github.workspace }} # location for the settings.xml file
19+
20+
- name: Code check
21+
run: ./gradlew check

.gitignore

Lines changed: 2 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -7,47 +7,12 @@
77
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
88

99
# User-specific stuff
10-
.idea/**/workspace.xml
11-
.idea/**/tasks.xml
12-
.idea/**/usage.statistics.xml
13-
.idea/**/dictionaries
14-
.idea/**/shelf
15-
16-
# Generated files
17-
.idea/**/contentModel.xml
18-
19-
# Sensitive or high-churn files
20-
.idea/**/dataSources/
21-
.idea/**/dataSources.ids
22-
.idea/**/dataSources.local.xml
23-
.idea/**/sqlDataSources.xml
24-
.idea/**/dynamic.xml
25-
.idea/**/uiDesigner.xml
26-
.idea/**/dbnavigator.xml
27-
28-
# Gradle
29-
.idea/**/gradle.xml
30-
.idea/**/libraries
31-
32-
# Gradle and Maven with auto-import
33-
# When using Gradle or Maven with auto-import, you should exclude module files,
34-
# since they will be recreated, and may cause churn. Uncomment if using
35-
# auto-import.
36-
# .idea/artifacts
37-
# .idea/compiler.xml
38-
# .idea/jarRepositories.xml
39-
# .idea/modules.xml
40-
# .idea/*.iml
41-
# .idea/modules
42-
# *.iml
43-
# *.ipr
10+
.idea/
11+
local.properties
4412

4513
# CMake
4614
cmake-build-*/
4715

48-
# Mongo Explorer plugin
49-
.idea/**/mongoSettings.xml
50-
5116
# File-based project format
5217
*.iws
5318

@@ -60,20 +25,12 @@ out/
6025
# JIRA plugin
6126
atlassian-ide-plugin.xml
6227

63-
# Cursive Clojure plugin
64-
.idea/replstate.xml
65-
6628
# Crashlytics plugin (for Android Studio and IntelliJ)
6729
com_crashlytics_export_strings.xml
6830
crashlytics.properties
6931
crashlytics-build.properties
7032
fabric.properties
7133

72-
# Editor-based Rest Client
73-
.idea/httpRequests
74-
75-
# Android studio 3.1+ serialized cache file
76-
.idea/caches/build_file_checksums.ser
7734

7835
### Intellij Patch ###
7936
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
@@ -83,28 +40,6 @@ fabric.properties
8340
# .idea/misc.xml
8441
# *.ipr
8542

86-
# Sonarlint plugin
87-
# https://plugins.jetbrains.com/plugin/7973-sonarlint
88-
.idea/**/sonarlint/
89-
90-
# SonarQube Plugin
91-
# https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin
92-
.idea/**/sonarIssues.xml
93-
94-
# Markdown Navigator plugin
95-
# https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced
96-
.idea/**/markdown-navigator.xml
97-
.idea/**/markdown-navigator-enh.xml
98-
.idea/**/markdown-navigator/
99-
100-
# Cache file creation bug
101-
# See https://youtrack.jetbrains.com/issue/JBR-2257
102-
.idea/$CACHE_FILE$
103-
104-
# CodeStream plugin
105-
# https://plugins.jetbrains.com/plugin/12206-codestream
106-
.idea/codestream.xml
107-
10843
### Kotlin ###
10944
# Compiled class file
11045
*.class

.idea/.gitignore

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

.idea/compiler.xml

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

.idea/jarRepositories.xml

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

.idea/misc.xml

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

.idea/vcs.xml

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

build.gradle.kts

Lines changed: 76 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,11 @@ plugins {
77
`java-library`
88
`maven-publish`
99
jacoco
10+
signing
1011
}
1112

12-
repositories {
13-
jcenter()
14-
mavenCentral()
15-
maven { url = uri("https://maven.pkg.jetbrains.space/public/p/compose/dev") }
16-
}
17-
18-
dependencies {
19-
testImplementation(kotlin("test-junit5"))
20-
testImplementation("org.junit.jupiter:junit-jupiter-api:5.6.0")
21-
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.6.0")
22-
implementation(compose.desktop.currentOs)
23-
}
24-
25-
tasks.test {
26-
useJUnitPlatform()
27-
}
28-
29-
tasks.withType<KotlinCompile>() {
30-
kotlinOptions.jvmTarget = "11"
31-
}
13+
group = "io.github.app-outlet"
14+
version = "1.0.1"
3215

3316
java {
3417
withJavadocJar()
@@ -38,12 +21,82 @@ java {
3821
publishing {
3922
publications {
4023
create<MavenPublication>("maven") {
41-
groupId = "io.appoutlet"
4224
artifactId = "karavel"
43-
version = "1.0"
44-
4525
from(components["java"])
26+
27+
pom {
28+
name.set("Karavel")
29+
description.set("Lightweight navigation library for Compose for Desktop")
30+
url.set("https://github.com/app-outlet/karavel")
31+
licenses {
32+
license {
33+
name.set("MIT License")
34+
url.set("https://github.com/app-outlet/karavel/blob/main/LICENSE")
35+
}
36+
}
37+
developers {
38+
developer {
39+
id.set("messiaslima")
40+
name.set("Messias Junior")
41+
email.set("[email protected]")
42+
}
43+
}
44+
scm {
45+
connection.set("scm:git:git://github.com/app-outlet/karavel.git")
46+
developerConnection.set("scm:git:ssh://github.com/app-outlet/karavel.git")
47+
url.set("https://github.com/app-outlet/karavel")
48+
}
49+
}
50+
}
51+
}
52+
repositories {
53+
maven {
54+
val releasesRepoUrl = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
55+
val snapshotsRepoUrl = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
56+
57+
name = "OSSRH"
58+
url = if (version.toString().endsWith("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl
59+
60+
credentials {
61+
username = System.getenv("OSSRH_USERNAME")
62+
password = System.getenv("OSSRH_PASSWORD")
63+
}
4664
}
4765
}
4866
}
4967

68+
signing {
69+
useInMemoryPgpKeys(
70+
System.getenv("GPG_KEY_ID"),
71+
System.getenv("GPG_SECRET_KEY"),
72+
System.getenv("GPG_PASSWORD")
73+
)
74+
sign(publishing.publications["maven"])
75+
}
76+
77+
tasks.javadoc {
78+
if (JavaVersion.current().isJava9Compatible) {
79+
(options as StandardJavadocDocletOptions).addBooleanOption("html5", true)
80+
}
81+
}
82+
83+
tasks.test {
84+
useJUnitPlatform()
85+
}
86+
87+
tasks.withType<KotlinCompile> {
88+
kotlinOptions.jvmTarget = "11"
89+
}
90+
91+
repositories {
92+
jcenter()
93+
mavenCentral()
94+
maven { url = uri("https://maven.pkg.jetbrains.space/public/p/compose/dev") }
95+
}
96+
97+
dependencies {
98+
testImplementation(kotlin("test-junit5"))
99+
testImplementation("org.junit.jupiter:junit-jupiter-api:5.6.0")
100+
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.6.0")
101+
implementation(compose.desktop.currentOs)
102+
}

0 commit comments

Comments
 (0)