-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from teogor/feature/maven-deploy
🚀 Enhancements: Sudoku Puzzle Generation Library
- Loading branch information
Showing
5 changed files
with
102 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Publish | ||
|
||
on: | ||
release: | ||
types: [ released ] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
publish: | ||
name: Snapshot build and publish | ||
runs-on: ubuntu-latest | ||
environment: PRODUCTION | ||
env: | ||
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.OSSRH_USERNAME }} | ||
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.OSSRH_PASSWORD }} | ||
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.SIGNING_KEY_ID }} | ||
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }} | ||
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }} | ||
steps: | ||
- name: Check out code | ||
uses: actions/[email protected] | ||
|
||
- name: Set up JDK 11 | ||
uses: actions/[email protected] | ||
with: | ||
distribution: 'zulu' | ||
java-version: 11 | ||
|
||
- name: Grant Permission to Execute Gradle | ||
run: chmod +x gradlew | ||
|
||
- name: Publish to MavenCentral | ||
run: | | ||
./gradlew publishAllPublicationsToMavenCentral |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
build-logic/convention/src/main/kotlin/MavenPublishLibraryConventionPlugin.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* Copyright 2023 Teogor (Teodor Grigor) | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import org.gradle.api.Plugin | ||
import org.gradle.api.Project | ||
|
||
class MavenPublishLibraryConventionPlugin : Plugin<Project> { | ||
override fun apply(target: Project) { | ||
with(target) { | ||
pluginManager.apply("com.vanniktech.maven.publish") | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,10 +13,12 @@ | |
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
import com.vanniktech.maven.publish.SonatypeHost | ||
import dev.teogor.sudoklify.buildlogic.BuildInfo | ||
|
||
plugins { | ||
id("sudoklify.kotlin.library") | ||
id("sudoklify.maven.publish.library") | ||
} | ||
|
||
group = BuildInfo.group.fullName | ||
|
@@ -29,3 +31,38 @@ tasks.test { | |
dependencies { | ||
testImplementation("junit:junit:4.13.2") | ||
} | ||
|
||
@Suppress("UnstableApiUsage") | ||
mavenPublishing { | ||
publishToMavenCentral(SonatypeHost.S01) | ||
|
||
signAllPublications() | ||
|
||
coordinates("dev.teogor.sudoklify", "sudoklify", "1.0.0-alpha01") | ||
|
||
pom { | ||
name.set("Sudoklify") | ||
description.set("Sudoklify stands as a versatile and user-friendly Sudoku puzzle generation library crafted in Kotlin. Effortlessly generate, manipulate, and solve Sudoku puzzles with ease.") | ||
inceptionYear.set("2023") | ||
url.set("https://github.com/teogor/sudoklify/") // Update this URL | ||
licenses { | ||
license { | ||
name.set("The Apache License, Version 2.0") | ||
url.set("https://www.apache.org/licenses/LICENSE-2.0") | ||
distribution.set("repo") | ||
} | ||
} | ||
developers { | ||
developer { | ||
id.set("teogor") // Update your GitHub username | ||
name.set("Teodor Grigor") // Update your name | ||
url.set("https://github.com/teogor/") | ||
} | ||
} | ||
scm { | ||
url.set("https://github.com/teogor/sudoklify/") // Update this URL | ||
connection.set("scm:git:https://github.com/teogor/sudoklify.git") // Update this connection URL | ||
developerConnection.set("scm:git:[email protected]:teogor/sudoklify.git") // Update this developer connection URL | ||
} | ||
} | ||
} |