I have published a library qt-data.jar in github maven repository and I wanted to use that library in another library qt-notification.jar. It seems that my local machine can pull the qt-data as I gave the necessary info in the build.gradle.kts file. But while packaging in the github repository, I’m getting error. Any help?
build.gradle.kts file structure:
plugins {
id("org.jetbrains.kotlin.jvm") version "1.3.70"
`maven-publish`
`java-library`
}
repositories {
jcenter()
maven("https://maven.pkg.github.com/my-username/qt-data") {
credentials{
username = "my-username"
password = System.getenv("GITHUB_TOKEN")
}
}
}
dependencies {
implementation(platform("org.jetbrains.kotlin:kotlin-bom"))
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
implementation("com.google.code.gson:gson:2.8.6")
implementation ("com.questtag:qt-data:0.0.4")
testImplementation("org.jetbrains.kotlin:kotlin-test")
testImplementation("org.jetbrains.kotlin:kotlin-test-junit")
}
publishing {
publications {
create("default") {
from(components["java"])
}
}
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/my-username/qt-localization")
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
}
gardlepublish.yml
name: Publish release
on:
release:
types: [published]
jobs:
publish-release:
runs-on: ubuntu-latest
steps:
- name: Checkout latest code
uses: actions/checkout@v2
- name: Set up JDK 8
uses: actions/setup-java@v1
with:
java-version: 8
- name: Setup build cache
uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Publish artifact
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# The GITHUB_REF tag comes in the format 'refs/tags/xxx'.
# So if we split on '/' and take the 3rd value, we can get the release name.
run: |
NEW_VERSION=$(echo "${GITHUB_REF}" | cut -d "/" -f3)
echo "New version: ${NEW_VERSION}"
echo "Github username: ${GITHUB_ACTOR}"
./gradlew -Pversion=${NEW_VERSION} publish --stacktrace