问题描述
我已经在github maven存储库中发布了一个库qt-data.jar,我想在另一个库qt-notification.jar中使用该库。好像我的本地计算机可以在build.gradle.kts文件中提供必要的信息时提取qt数据。但是,当打包到github存储库中时,出现了错误。有帮助吗?
build.gradle.kts文件结构:
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
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)