Skip to content

Commit

Permalink
Add CI workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
RowDaBoat committed Feb 19, 2024
1 parent ef24fbc commit 085566b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 11 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
name: Build with Gradle
name: Publish

on:
push:
branches:
- main
- trunk

jobs:
build:
runs-on: ubuntu-latest
permissions:
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up JDK 11
- name: Setup JDK
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'

- name: Build with Gradle
run: ./gradlew build

- name: Publish
run: ./gradlew publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16 changes: 11 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
kotlin("jvm") version "1.7.10"
kotlin("jvm") version "1.9.0"
id("maven-publish")
`maven-publish`
}
Expand All @@ -26,8 +24,8 @@ tasks.test {
useJUnitPlatform()
}

tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
kotlin {
jvmToolchain(11)
}

publishing {
Expand All @@ -37,5 +35,13 @@ publishing {

repositories {
mavenLocal()
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/RowDaBoat/kobold-parsing-kit")
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
}

0 comments on commit 085566b

Please sign in to comment.