Skip to content

Commit

Permalink
Merge pull request #23 from jGleitz/fix-realease
Browse files Browse the repository at this point in the history
ci: Fix GitHub Package publishing

edit to trigger release
  • Loading branch information
jGleitz committed Feb 7, 2020
2 parents f505042 + cebcf6f commit 30b300d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
run: ./gradlew build

release:
name: Release
name: Release Check
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/master'
Expand All @@ -45,7 +45,7 @@ jobs:
uses: actions/setup-node@v1
with:
node-version: 12
- name: Release
- name: Release Check
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }}
run: npx semantic-release@17
14 changes: 9 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ on:
types: [published]

jobs:
publish:
name: Publish Artefacts
release:
name: Release Artefacts
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -25,13 +25,17 @@ jobs:
java-version: 13
- name: Prepare
run: ./gradlew clean dependencies
- name: Release to Maven Central
- name: Assemble Artefacts
run: ./gradlew assemble
env:
ORG_GRADLE_PROJECT_githubRepository: ${{ github.repository }}
- name: Release Artefacts
run: ./gradlew release
env:
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.PACKAGE_SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingKeyPassword: ${{ secrets.PACKAGE_SIGNING_KEY_PASSWORD }}
ORG_GRADLE_PROJECT_githubRepository: ${{ github.repository }}
ORG_GRADLE_PROJECT_githubToken: ${{ github.token }}
ORG_GRADLE_PROJECT_githubToken: ${{ secrets.RELEASE_GITHUB_TOKEN }}
ORG_GRADLE_PROJECT_ossrhUsername: ${{ secrets.OSSRH_USERNAME }}
ORG_GRADLE_PROJECT_ossrhPassword: ${{ secrets.OSSRH_PASSWORD }}

Expand All @@ -55,7 +59,7 @@ jobs:
java-version: 13
- name: Prepare
run: ./gradlew clean dependencies
- name: Assemble
- name: Generate Documentation
run: ./gradlew dokka
env:
ORG_GRADLE_PROJECT_githubRepository: ${{ github.repository }}
Expand Down
5 changes: 2 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,11 @@ nexusStaging {

val closeAndReleaseRepository by project.tasks
closeAndReleaseRepository.mustRunAfter(mavenCentral.publishTask)
val publish by tasks


task("release") {
group = "release"
description = "Releases the project to Maven Central"
dependsOn(publish, closeAndReleaseRepository)
dependsOn(githubPackages.publishTask, mavenCentral.publishTask, closeAndReleaseRepository)
}

idea {
Expand All @@ -179,4 +177,5 @@ fun String.drop(prefix: String) = if (this.startsWith(prefix)) this.drop(prefix.
val Project.versionDetails
get() = (this.extra["versionDetails"] as groovy.lang.Closure<*>)() as com.palantir.gradle.gitversion.VersionDetails

val ArtifactRepository.publishTask get() = tasks["publishAllPublicationsTo${this.name}Repository"]
val NexusRepository.publishTask get() = tasks["publishTo${this.name.capitalize()}"]

0 comments on commit 30b300d

Please sign in to comment.