Skip to content

Commit

Permalink
use setup-actions
Browse files Browse the repository at this point in the history
  • Loading branch information
martinbonnin committed Jul 12, 2024
1 parent 3c1c5b7 commit a2cbbab
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ jobs:

steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 #v4.1.7
- uses: gradle/actions/setup-gradle@dbbdc275be76ac10734476cc723d82dfe7ec6eda #v3.4.2
- run: |
./gradlew build
16 changes: 6 additions & 10 deletions librarian-core/src/main/resources/actions/publish-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,34 +14,30 @@ jobs:
build-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 #v4.1.7
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 #v4.1.7
with:
fetch-depth: 0

- name: Build docs using Writerside Docker builder
uses: JetBrains/writerside-github-action@5a6920dbce3ef3169acbeb7e45c6cbdaf7e76bfa #v4
- uses: JetBrains/writerside-github-action@5a6920dbce3ef3169acbeb7e45c6cbdaf7e76bfa #v4
with:
instance: ${{ env.INSTANCE }}
artifact: ${{ env.ARTIFACT }}
docker-version: ${{ env.DOCKER_VERSION }}

- name: Prepare static content
run: |
- uses: gradle/actions/setup-gradle@dbbdc275be76ac10734476cc723d82dfe7ec6eda #v3.4.2
- run: |
export JAVA_HOME=$JAVA_HOME_21_X64 # Remove when ubuntu-latest updates to Java 21
./gradlew dokkatooGeneratePublicationHtml
mkdir -p build/static
cp -rf build/dokka/html build/static/kdoc
unzip artifacts/webHelpDOC2-all.zip -d build/static
- name: Deploy Kdoc to github pages
uses: JamesIves/github-pages-deploy-action@5c6e9e9f3672ce8fd37b9856193d2a537941e66c #v4.6.1
- uses: JamesIves/github-pages-deploy-action@94f3c658273cf92fb48ef99e5fbc02bd2dc642b2 #v4.6.3
with:
branch: gh-pages # The branch the action should deploy to.
folder: build/static # The folder the action should deploy.

- name: Save artifact with build results
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 #v4.3.3
- uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b #v4.3.4
with:
name: docs
path: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:

steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 #v4.1.7
- uses: gradle/actions/setup-gradle@dbbdc275be76ac10734476cc723d82dfe7ec6eda #v3.4.2
- run: |
./gradlew librarianPublishToMavenCentral
gh release create $GITHUB_REF_NAME --title $GITHUB_REF_NAME --verify-tag --notes-from-tag
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ jobs:

steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 #v4.1.7
- uses: gradle/actions/setup-gradle@dbbdc275be76ac10734476cc723d82dfe7ec6eda #v3.4.2
- run: |
./gradlew librarianPublishToMavenSnapshots
env:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:

steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 #v4.1.7
- uses: gradleup/librarian/tag-and-bump@main
- uses: gradleup/librarian/tag-and-bump@2cdb4fa8a36657aec1b52d2c5ec836f04713a80c #v0.0.4
with:
versionToRelease: ${{ inputs.versionToRelease }}
# Trigger a workflow manually because actions cannot trigger workflows to avoid endless loops
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.gradleup.librarian.gradle

import org.gradle.api.Project
import java.util.*

fun Project.librarianProperties(): Properties {
return rootProject.file("librarian.properties").let {
require (it.exists()) {
"No librarian.properties found at ${it.absolutePath}"
}
Properties().apply {
it.inputStream().use {
load(it)
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import com.gradleup.librarian.gradle.internal.findEnvironmentVariable
import org.gradle.api.Project
import java.util.Properties

internal fun Properties.javaCompatibility(): Int? {
fun Properties.javaCompatibility(): Int? {
return getProperty("java.compatibility")?.toInt()
}

internal fun Properties.kotlinCompatibility(): String? {
fun Properties.kotlinCompatibility(): String? {
return getProperty("kotlin.compatibility")
}

internal fun Properties.versionPackageName(): String? {
fun Properties.versionPackageName(): String? {
return getProperty("version.packageName")
}

Expand Down

0 comments on commit a2cbbab

Please sign in to comment.