Skip to content

Commit

Permalink
feat(ci): GH package publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
jenspots committed May 23, 2024
1 parent 6a0e65b commit 360477a
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 33 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Publish package to GitHub Packages

on:
release:
types: [created]

jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0
- name: Publish package
run: ./gradlew publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
65 changes: 35 additions & 30 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,48 +1,53 @@
plugins {
application
id("com.github.johnrengelman.shadow") version "8.1.1"
kotlin("jvm") version "1.9.22"
application
id("com.github.johnrengelman.shadow") version "8.1.1"
kotlin("jvm") version "1.9.22"
id("maven-publish")
}

group = "technology.idlab"
version = "1.0-SNAPSHOT"

application {
mainClass.set("technology.idlab.MainKt")
}
version = "0.0.1"

application { mainClass.set("technology.idlab.MainKt") }

tasks.shadowJar {
manifest.attributes.apply {
put("Main-Class", "technology.idlab.MainKt")
}
mergeServiceFiles()
manifest.attributes.apply { put("Main-Class", "technology.idlab.MainKt") }
mergeServiceFiles()
}

repositories {
mavenCentral()
}
repositories { mavenCentral() }

dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.0")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.0")

// HTTP dependencies.
implementation("io.ktor:ktor-client-core:2.3.10")
implementation("io.ktor:ktor-client-cio:2.3.10")
implementation("io.ktor:ktor-server-core:2.3.10")
implementation("io.ktor:ktor-server-netty:2.3.10")
// HTTP dependencies.
implementation("io.ktor:ktor-client-core:2.3.10")
implementation("io.ktor:ktor-client-cio:2.3.10")
implementation("io.ktor:ktor-server-core:2.3.10")
implementation("io.ktor:ktor-server-netty:2.3.10")

// RDF dependencies.
implementation("org.apache.jena:apache-jena-libs:5.0.0")
implementation("org.apache.jena:jena-arq:5.0.0")
// RDF dependencies.
implementation("org.apache.jena:apache-jena-libs:5.0.0")
implementation("org.apache.jena:jena-arq:5.0.0")

// Initialize testing.
testImplementation("org.jetbrains.kotlin:kotlin-test")
// Initialize testing.
testImplementation("org.jetbrains.kotlin:kotlin-test")
}

tasks.test {
useJUnitPlatform()
}
tasks.test { useJUnitPlatform() }

kotlin { jvmToolchain(17) }

kotlin {
jvmToolchain(17)
publishing {
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/rdf-connect/jvm-runner")
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
}
5 changes: 2 additions & 3 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "0.5.0"
}
plugins { id("org.gradle.toolchains.foojay-resolver-convention") version "0.5.0" }

rootProject.name = "technology.idlab.jvm-runner"

0 comments on commit 360477a

Please sign in to comment.