Skip to content

Commit f505042

Browse files
authored
Merge pull request #22 from jGleitz/fix-release
Fix release
2 parents c5598ef + bb163d7 commit f505042

File tree

2 files changed

+19
-9
lines changed

2 files changed

+19
-9
lines changed

.github/workflows/release.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ jobs:
3131
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.PACKAGE_SIGNING_KEY }}
3232
ORG_GRADLE_PROJECT_signingKeyPassword: ${{ secrets.PACKAGE_SIGNING_KEY_PASSWORD }}
3333
ORG_GRADLE_PROJECT_githubRepository: ${{ github.repository }}
34+
ORG_GRADLE_PROJECT_githubToken: ${{ github.token }}
3435
ORG_GRADLE_PROJECT_ossrhUsername: ${{ secrets.OSSRH_USERNAME }}
3536
ORG_GRADLE_PROJECT_ossrhPassword: ${{ secrets.OSSRH_PASSWORD }}
3637

@@ -60,9 +61,6 @@ jobs:
6061
ORG_GRADLE_PROJECT_githubRepository: ${{ github.repository }}
6162
- name: Publish Documentation
6263
uses: peaceiris/[email protected]
63-
env:
64-
ACTIONS_DEPLOY_KEY: ${{ secrets.GH_PAGES_DEPLOY_KEY }}
65-
PUBLISH_BRANCH: gh-pages
66-
PUBLISH_DIR: ./build/dokka
6764
with:
68-
emptyCommits: false
65+
publish_dir: ./build/dokka
66+
deploy_key: ${{ secrets.GH_PAGES_DEPLOY_KEY }}

build.gradle.kts

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ artifacts {
7878
}
7979

8080
lateinit var publication: MavenPublication
81-
lateinit var releaseRepository: NexusRepository
81+
lateinit var githubPackages: ArtifactRepository
82+
lateinit var mavenCentral: NexusRepository
8283

8384
publishing {
8485
publications {
@@ -121,11 +122,20 @@ publishing {
121122
}
122123
}
123124
}
125+
repositories {
126+
githubPackages = maven("https://maven.pkg.github.com/$githubRepository") {
127+
name = "GitHubPackages"
128+
credentials {
129+
username = githubOwner
130+
password = githubToken
131+
}
132+
}
133+
}
124134
}
125135

126136
nexusPublishing {
127137
repositories {
128-
releaseRepository = sonatype {
138+
mavenCentral = sonatype {
129139
username.set(ossrhUsername)
130140
password.set(ossrhPassword)
131141
}
@@ -145,12 +155,14 @@ nexusStaging {
145155
}
146156

147157
val closeAndReleaseRepository by project.tasks
148-
closeAndReleaseRepository.mustRunAfter(releaseRepository.publishTask)
158+
closeAndReleaseRepository.mustRunAfter(mavenCentral.publishTask)
159+
val publish by tasks
160+
149161

150162
task("release") {
151163
group = "release"
152164
description = "Releases the project to Maven Central"
153-
dependsOn(releaseRepository.publishTask, closeAndReleaseRepository)
165+
dependsOn(publish, closeAndReleaseRepository)
154166
}
155167

156168
idea {

0 commit comments

Comments
 (0)