Skip to content

Commit

Permalink
Add license information and prep for Maven Central publishing (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
markelliot authored Dec 6, 2021
1 parent 3c6500e commit fb156ff
Show file tree
Hide file tree
Showing 35 changed files with 496 additions and 207 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/check-for-updates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ on:
jobs:
check:
runs-on: ubuntu-latest
env:
# used by Gradle to read packages published by other repos
GH_READ_PACKAGES_TOKEN: ${{ secrets.GH_READ_PACKAGES_TOKEN }}
steps:
- uses: actions/checkout@v2
with:
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ jobs:
permissions:
contents: read
packages: write
env:
GH_READ_PACKAGES_TOKEN: ${{ secrets.GH_READ_PACKAGES_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ jobs:
permissions:
contents: read
packages: write
env:
GH_READ_PACKAGES_TOKEN: ${{ secrets.GH_READ_PACKAGES_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
Expand All @@ -20,7 +18,10 @@ jobs:
- name: Build
run: ./gradlew --no-daemon build
- name: Publish
run: ./gradlew --no-daemon publish
run: ./gradlew --no-daemon publishToSonatype closeAndReleaseSonatypeStagingRepository
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MAVEN_CENTRAL_USER: ${{ secrets.MAVEN_CENTRAL_USER }}
MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}

49 changes: 34 additions & 15 deletions barista/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import java.net.URI

plugins {
`java-library`
`maven-publish`
`signing`
}

dependencies {
Expand All @@ -14,7 +13,7 @@ dependencies {
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jdk8")
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310")
implementation("com.google.guava:guava")
implementation("io.github.markelliot.barista-tracing:barista-tracing")
implementation("com.markelliot.barista.tracing:barista-tracing")
implementation("io.undertow:undertow-core")

implementation("org.apache.logging.log4j:log4j-core")
Expand All @@ -39,26 +38,46 @@ tasks.test {
}

java {
withJavadocJar()
withSourcesJar()
}

publishing {
publications {
create<MavenPublication>("library") {
create<MavenPublication>("mavenJava") {
from(components["java"])
}
}

repositories {
maven {
name = "GitHubPackages"
url = URI.create("https://maven.pkg.github.com/markelliot/barista")
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
suppressPomMetadataWarningsFor("javadocElements")
pom {
name.set("barista")
description.set("an opinionated java server library.")
url.set("https://github.com/markelliot/barista")
licenses {
license {
name.set("Apache License, Version 2.0")
url.set("https://www.apache.org/licenses/LICENSE-2.0")
}
}
developers {
developer {
id.set("markelliot")
name.set("Mark Elliot")
email.set("[email protected]")
}
}
scm {
connection.set("scm:git:https://github.com/markelliot/barista.git")
developerConnection.set("scm:git:https://github.com/markelliot/barista.git")
url.set("https://github.com/markelliot/barista")
}
}
}
}
}

tasks["publishLibraryPublicationToGitHubPackagesRepository"].enabled = System.getenv("GITHUB_ACTOR") != null
configure<SigningExtension> {
val key = System.getenv("SIGNING_KEY")
val password = System.getenv("SIGNING_PASSWORD")
val publishing: PublishingExtension by project
useInMemoryPgpKeys(key, password)
sign(publishing.publications)
}
21 changes: 0 additions & 21 deletions barista/src/main/java/barista/Endpoints.java

This file was deleted.

21 changes: 0 additions & 21 deletions barista/src/main/java/barista/HttpMethod.java

This file was deleted.

4 changes: 0 additions & 4 deletions barista/src/main/java/barista/authz/AuthToken.java

This file was deleted.

17 changes: 0 additions & 17 deletions barista/src/main/java/barista/authz/AuthTokens.java

This file was deleted.

18 changes: 0 additions & 18 deletions barista/src/main/java/barista/authz/Authz.java

This file was deleted.

16 changes: 0 additions & 16 deletions barista/src/main/java/barista/authz/DenyAllAuthz.java

This file was deleted.

3 changes: 0 additions & 3 deletions barista/src/main/java/barista/authz/VerifiedAuthToken.java

This file was deleted.

This file was deleted.

37 changes: 37 additions & 0 deletions barista/src/main/java/com/markelliot/barista/Endpoints.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* (c) Copyright 2021 Mark Elliot. All rights reserved.
*
* 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
*
* http://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.
*/

package com.markelliot.barista;

import com.markelliot.barista.authz.VerifiedAuthToken;

public final class Endpoints {
private interface Endpoint<Request> {
Class<Request> requestClass();

String path();

HttpMethod method();
}

public interface VerifiedAuth<Request, Response> extends Endpoint<Request> {
Response call(VerifiedAuthToken authToken, Request request);
}

public interface Open<Request, Response> extends Endpoint<Request> {
Response call(Request request);
}
}
37 changes: 37 additions & 0 deletions barista/src/main/java/com/markelliot/barista/HttpMethod.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* (c) Copyright 2021 Mark Elliot. All rights reserved.
*
* 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
*
* http://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.
*/

package com.markelliot.barista;

import io.undertow.util.HttpString;
import io.undertow.util.Methods;

@SuppressWarnings("ImmutableEnumChecker")
public enum HttpMethod {
GET(Methods.GET),
PUT(Methods.PUT),
POST(Methods.POST);

private final HttpString method;

HttpMethod(HttpString method) {
this.method = method;
}

public HttpString method() {
return method;
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
package barista;
/*
* (c) Copyright 2021 Mark Elliot. All rights reserved.
*
* 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
*
* http://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.
*/

package com.markelliot.barista;

import java.net.URI;
import org.apache.logging.log4j.Level;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
package barista;
/*
* (c) Copyright 2021 Mark Elliot. All rights reserved.
*
* 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
*
* http://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.
*/

package com.markelliot.barista;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.core.JsonProcessingException;
Expand Down
Loading

0 comments on commit fb156ff

Please sign in to comment.