Skip to content

Commit

Permalink
add publishing configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
froks committed Jun 16, 2024
1 parent cdf2f8e commit be874ee
Show file tree
Hide file tree
Showing 7 changed files with 150 additions and 4 deletions.
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "gradle"
directory: "/"
schedule:
interval: "weekly"
27 changes: 27 additions & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle

name: Java CI with Gradle

on: [push]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 21
uses: actions/setup-java@v2
with:
java-version: '21'
distribution: 'temurin'
- name: Build with Gradle
uses: gradle/gradle-build-action@4137be6a8bf7d7133955359dbd952c0ca73b1021
with:
arguments: build test
36 changes: 36 additions & 0 deletions .github/workflows/publish_on_tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle

name: Publish to mavencentral

on:
push:
tags:
- '*'

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 21
uses: actions/setup-java@v2
with:
java-version: '21'
distribution: 'temurin'
- name: Build and publish with Gradle
uses: gradle/gradle-build-action@4137be6a8bf7d7133955359dbd952c0ca73b1021
with:
arguments: jreleaserConfig build test publish jreleaserFullRelease
env:
JRELEASER_GPG_SECRET_KEY: ${{ secrets.JRELEASER_GPG_SECRET_KEY }}
JRELEASER_GPG_PASSPHRASE: ${{ secrets.JRELEASER_GPG_PASSPHRASE }}
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
JRELEASER_MAVENCENTRAL_SONATYPE_USERNAME: ${{ secrets.JRELEASER_MAVENCENTRAL_SONATYPE_USERNAME }}
JRELEASER_MAVENCENTRAL_SONATYPE_TOKEN: ${{ secrets.JRELEASER_MAVENCENTRAL_SONATYPE_TOKEN }}

16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# dlt-core

dlt-core is a kotlin library to parse autosar dlt files.

It currently only supports dlt version 1.

Usage:
```kotlin
DltMessageParser.parseFile(Path.of("file.dlt")).forEach {
val msg = it.dltMessage as DltMessageV1
if (msg.extendedHeader?.apIdText != "MYAP") {
return@forEach
}
// do stuff with msg
}
```
64 changes: 60 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jreleaser.model.Active

plugins {
kotlin("jvm").version("2.0.0")
`java-library`
signing
`maven-publish`
id("org.jreleaser") version "1.12.0"
}

group = "io.github.froks"
Expand All @@ -21,8 +24,11 @@ tasks.test {
}

kotlin {
jvmToolchain(17)
jvmToolchain(21)
explicitApi()
compilerOptions {
jvmTarget = JvmTarget.JVM_1_8
}
}

java {
Expand All @@ -36,6 +42,56 @@ tasks.withType<JavaCompile>().configureEach {
}

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
kotlinOptions.jvmTarget = "1.8"
kotlinOptions.freeCompilerArgs += "-opt-in=kotlin.RequiresOptIn"
compilerOptions {
jvmTarget.set(JvmTarget.JVM_1_8)
freeCompilerArgs.add("-opt-in=kotlin.RequiresOptIn")
}
}

publishing {
publications {
create<MavenPublication>("mavenJava") {
from(components["java"])
pom {
name.set("dlt-core")
description.set("Kotlin based parser library for autosar dlt files")
url.set("https://github.com/froks/dlt-core")
developers {
developer {
id.set("froks")
name.set("Florian Roks")
email.set("[email protected]")
}
}
scm {
url.set("https://github.com/froks/dlt-core")
developerConnection.set("scm:git:ssh://github.com:froks/dlt-core.git")
connection.set("scm:git:git://github.com/froks/dlt-core.git")
}
licenses {
license {
name.set("The Apache License, Version 2.0")
url.set("https://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
}
}
}
}

jreleaser {
signing {
active = Active.ALWAYS
armored = true
verify = false
}
deploy {
maven {
mavenCentral.create("sonatype") {
active = Active.ALWAYS
url = "https://central.sonatype.com/api/v1/publisher"
stagingRepository("target/staging-deploy")
}
}
}
}
Empty file modified gradlew
100644 → 100755
Empty file.
Empty file modified gradlew.bat
100644 → 100755
Empty file.

0 comments on commit be874ee

Please sign in to comment.