Skip to content

Commit

Permalink
Added workflow for publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
khbminus committed May 23, 2024
1 parent 3a2936a commit 87a84d2
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 2 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Continuous Integration
on: push
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- uses: actions/checkout@v4
- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
cache: 'gradle'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Build the project
run: ./gradlew build
24 changes: 24 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Publish the library in Maven and make a release
on:
push:
tags:
- 'v**'
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
cache: 'gradle'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Publish version to Maven
env:
GITHUB_TOKEN: ${{ secrets.MY_TOKEN }} # Workaround, since the permissions are hard
GITHUB_USERNAME: khbminus
run: ./gradlew publish

15 changes: 13 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
}

group = "org.jetbrains.plan"
version = "0.0.1"
version = "0.0.2"

repositories {
mavenCentral()
Expand All @@ -19,11 +19,22 @@ publishing {
create<MavenPublication>("runner") {
groupId = "org.jetbrains.plan"
artifactId = "experiment-runner"
version = "0.0.1"
version = project.version.toString()

from(components["java"])
}
}
repositories {
maven {
url = uri("https://maven.pkg.github.com/plan-research/kotlin-maven")
credentials {
username = project.findProperty("gpr.user")?.toString() ?: System.getenv("GITHUB_USERNAME")
password = project.findProperty("gpr.token")?.toString() ?: System.getenv("GITHUB_TOKEN")
println(password?.length)
println(username)
}
}
}
}

tasks.test {
Expand Down

0 comments on commit 87a84d2

Please sign in to comment.