diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f699724b3..a3e9d3ca1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,15 +24,18 @@ jobs: with: # Due to some limitations of https://github.com/node-gradle/gradle-node-plugin. node-version: '16' + # Used for gitPublish tasks. + - name: Set up Git + run: | + git config --global user.name 'github-actions[bot]' + git config --global user.email 'github-actions[bot]@users.noreply.github.com' # Disable CC due to https://github.com/gradle/gradle/issues/22779 - run: ./gradlew releaseAll --no-configuration-cache env: GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_KEY }} GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_SECRET }} - # We must declare repository_owner as the user, workaround for https://github.com/ajoberstar/gradle-git-publish/issues/109. - GRGIT_USER: ${{ github.repository_owner }} - # https://ajoberstar.org/grgit/main/grgit-authentication.html#_environment_variables - GRGIT_PASS: ${{ secrets.GITHUB_TOKEN }} + GITHUB_USER: ${{ github.repository_owner }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.OSSRH_USER }} ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.OSSRH_PASSWORD }} ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_KEY }} diff --git a/build-logic/build.gradle.kts b/build-logic/build.gradle.kts index 8b966f0e4..997d037f7 100644 --- a/build-logic/build.gradle.kts +++ b/build-logic/build.gradle.kts @@ -11,6 +11,6 @@ dependencies { implementation("com.gradle.publish:plugin-publish-plugin:1.3.0") implementation("com.vanniktech:gradle-maven-publish-plugin:0.30.0") implementation("org.jetbrains.dokka:org.jetbrains.dokka.gradle.plugin:1.9.20") - implementation("org.ajoberstar.git-publish:gradle-git-publish:5.0.0") + implementation("org.ajoberstar.git-publish:gradle-git-publish:5.1.0") implementation("com.github.node-gradle:gradle-node-plugin:7.1.0") } diff --git a/build-logic/src/main/kotlin/shadow.convention.deploy.gradle.kts b/build-logic/src/main/kotlin/shadow.convention.deploy.gradle.kts index 39f4dd10f..72432ea02 100644 --- a/build-logic/src/main/kotlin/shadow.convention.deploy.gradle.kts +++ b/build-logic/src/main/kotlin/shadow.convention.deploy.gradle.kts @@ -8,10 +8,12 @@ plugins { gitPublish { repoUri = "https://github.com/GradleUp/shadow.git" branch = "gh-pages" + username = providers.environmentVariable("GITHUB_USER") + password = providers.environmentVariable("GITHUB_TOKEN") contents { - from("build/site") - into("api") { - from(tasks.named("dokkaHtml")) + from(yarnBuild) + from(tasks.named("dokkaHtml")) { + into("api") } filter( "tokens" to mapOf( @@ -22,16 +24,8 @@ gitPublish { } } -node { - yarnVersion = "1.5.1" -} - val yarnBuild = tasks.named("yarn_build") { + dependsOn(tasks.yarn) inputs.files(fileTree("src/docs")) outputs.dir(file("build/site")) - dependsOn(tasks.yarn) -} - -tasks.gitPublishCopy { - dependsOn(yarnBuild, tasks.named("dokkaHtml")) }