Skip to content

Commit

Permalink
Move to maven central.
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastianStehle committed Sep 3, 2024
1 parent 67f0f89 commit fcc6176
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 33 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ jobs:
- name: Publish to maven
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
run: |
./gradlew publish
./gradlew publishAllPublicationsToMavenCentralRepository
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
MAVEN_PUBLISH_REGISTRY_URL: "https://s01.oss.sonatype.org/content/repositories/releases/"
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_PRIVATE_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,7 @@ build
local.properties

# OpenAPI Generator creates a copy for whatver reason
/api
/api

# Publish Test with potential secrets
test-publish.ps1
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2017 Qaisar Ahmad & Sebastian Stehle

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
55 changes: 31 additions & 24 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import com.vanniktech.maven.publish.SonatypeHost

plugins {
id 'java-library'
id 'maven-publish'
id 'com.diffplug.spotless' version '6.11.0'
id "com.vanniktech.maven.publish" version "0.29.0"
}

repositories {
mavenCentral()
maven {
url 'https://s01.oss.sonatype.org/content/repositories/releases/'
}
}

dependencies {
Expand All @@ -31,11 +31,6 @@ spotless {
}
}

java {
withSourcesJar()
withJavadocJar()
}

javadoc {
options.tags = ["http.response.details:a:Http Response Details"]

Expand All @@ -51,23 +46,35 @@ test {
}
}

publishing {
publications {
maven(MavenPublication) {
groupId = 'io.squidex'
artifactId = 'squidex'
version = '2.0.0-rc1'
from components.java
}
mavenPublishing {
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL)

coordinates("io.squidex", "squidex", "2.0.0-RC1")

pom {
name = "Squidex SDK"
description = "Client Library for the Squidex API"
inceptionYear = "2020"
url = "https://github.com/squidex/sdk-java"
licenses {
license {
name = "MIT"
}
}
repositories {
maven {
url "$System.env.MAVEN_PUBLISH_REGISTRY_URL"
credentials {
username "$System.env.MAVEN_USERNAME"
password "$System.env.MAVEN_PASSWORD"
}
}
developers {
developer {
id = "sebastianstehle"
name = "Sebastian Stehle"
url = "https://github.com/sebastianstehle/"
}
}
scm {
url = "https://github.com/squidex/squidex/"
connection = "scm:git:git://github.com/squidex/squidex.git"
developerConnection = "scm:git:ssh://[email protected]/squidex/squidex.git"
}
}

signAllPublications()
}

4 changes: 2 additions & 2 deletions generate.ps1
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# docker run --rm -v ${PWD}:/local squidex/openapi-generator-cli config-help -g php
docker run --rm -v ${PWD}:/local squidex/openapi-generator-cli generate -i /local/openapi.json -g java --template-dir /local/templates -o /local -c /local/openapi-config.yml
# docker run --rm -v ${PWD}:/local openapitools/openapi-generator-cli config-help -g php
docker run --rm -v ${PWD}:/local openapitools/openapi-generator-cli generate -i /local/openapi.json -g java --template-dir /local/templates -o /local -c /local/openapi-config.yml
5 changes: 4 additions & 1 deletion openapi-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,7 @@ additionalProperties:
invokerPackage: com.squidex.api.core
modelPackage: com.squidex.api.types
useRuntimeException: true
useSingleRequestParameter: true
useSingleRequestParameter: true

reservedWordsMappings:
file: file
1 change: 0 additions & 1 deletion settings.gradle

This file was deleted.

0 comments on commit fcc6176

Please sign in to comment.