Skip to content

Commit

Permalink
add github workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
muatik committed May 28, 2024
1 parent 7501794 commit 34a94fe
Show file tree
Hide file tree
Showing 4 changed files with 131 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: gradle
directory: "/"
schedule:
interval: daily
53 changes: 53 additions & 0 deletions .github/workflows/pre-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: PR Checks
on:
push:
branches:
- main
pull_request:
branches:
- '*'

jobs:
tests:
name: Run tests
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Run tests
uses: gradle/gradle-build-action@v2
with:
arguments: test
publish:
name: Check that the publish plugin works
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Check that the publish plugin works
env:
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGKEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGPASSWORD }}
uses: gradle/gradle-build-action@v2
with:
arguments: publishToMavenLocal
lint:
name: Check that the code is formatted
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Check that the code is formatted
uses: gradle/gradle-build-action@v2
with:
arguments: ktlintCheck
compile-test-snippets:
name: Compile test snippets and run the tests
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Compile the snippets in the tests and run the tests
uses: gradle/gradle-build-action@v2
with:
arguments: test -Pcompile-test-snippets
7 changes: 7 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Copyright 2022 Wolt Enterprises Oy

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.
65 changes: 65 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ plugins {
kotlin("jvm") version "1.9.21"
kotlin("plugin.serialization") version "1.9.23"
id("com.diffplug.spotless") version "6.25.0"
id("maven-publish")
id("signing")
}

group = "com.wolt"
Expand All @@ -10,6 +12,11 @@ version = "1.0-SNAPSHOT"

repositories { mavenCentral() }

java {
withSourcesJar()
withJavadocJar()
}

dependencies {
val ktorVersion = "2.3.9"
api("io.ktor:ktor-server-core-jvm:${ktorVersion}")
Expand Down Expand Up @@ -37,3 +44,61 @@ spotless {
}
kotlinGradle { ktfmt("0.47").kotlinlangStyle() }
}

publishing {
publications {
create<MavenPublication>("mavenJava") {
from(components["kotlin"])
groupId = project.group.toString()
artifactId = project.name
version = project.version.toString()
artifact(tasks.kotlinSourcesJar)
artifact(tasks.named("javadocJar"))

pom {
name.set("Ktor Idempotency Plugin")
description.set("A Ktor plugin for handling idempotency in HTTP requests")
url.set("https://github.com/woltapp/ktor-idempotency")

name.set("Your Project Name")
description.set("A description of your project")
url.set("https://your.project.url")
licenses {
license {
name.set("The MIT License")
url.set("https://github.com/woltapp/ktor-idempotency/blob/main/LICENSE")
}
}
developers {
developer {
id.set("muatik")
name.set("Mustafa Atik")
email.set("[email protected]")
}
}
scm {
connection.set("scm:git:https://github.com/woltapp/ktor-idempotency.git")
developerConnection.set(
"scm:git:https://github.com/woltapp/ktor-idempotency.git"
)
url.set("https://github.com/woltapp/ktor-idempotency")
}
}
}
}

repositories {
maven {
name = "sonatype"
url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
credentials(PasswordCredentials::class)
}
}
}

signing {
val signingKey: String? by project
val signingPassword: String? by project
useInMemoryPgpKeys(signingKey, signingPassword)
sign(publishing.publications["mavenJava"])
}

0 comments on commit 34a94fe

Please sign in to comment.