diff --git a/.github/workflows/build-pull-request.yaml b/.github/workflows/build-pull-request.yaml new file mode 100644 index 0000000..ed9936a --- /dev/null +++ b/.github/workflows/build-pull-request.yaml @@ -0,0 +1,13 @@ +name: Build pull request + +on: pull_request + +jobs: + build-pull-request: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 #v4.1.7 + - uses: gradle/actions/setup-gradle@dbbdc275be76ac10734476cc723d82dfe7ec6eda #v3.4.2 + - run: | + ./gradlew build diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml deleted file mode 100644 index d8daede..0000000 --- a/.github/workflows/pr.yaml +++ /dev/null @@ -1,12 +0,0 @@ -name: pr - -on: pull_request - -jobs: - pr: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 #v4.1.7 - - run: | - ./gradlew build -x assemble # remove '-x assemble' when https://github.com/GradleUp/librarian/pull/6 is released diff --git a/.github/workflows/publish-pages-with-writerside.yaml b/.github/workflows/publish-pages-with-writerside.yaml new file mode 100644 index 0000000..afe3d8b --- /dev/null +++ b/.github/workflows/publish-pages-with-writerside.yaml @@ -0,0 +1,36 @@ +name: Publish documentation + +on: + push: + branches: ["main"] + workflow_dispatch: + +env: + INSTANCE: 'Writerside/doc' + ARTIFACT: 'webHelpDOC2-all.zip' + DOCKER_VERSION: '241.18775' + +jobs: + build-docs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 #v4.1.7 + with: + fetch-depth: 0 + + - uses: JetBrains/writerside-github-action@5a6920dbce3ef3169acbeb7e45c6cbdaf7e76bfa #v4 + with: + instance: ${{ env.INSTANCE }} + artifact: ${{ env.ARTIFACT }} + docker-version: ${{ env.DOCKER_VERSION }} + + - 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 librarianStaticContent + unzip artifacts/webHelpDOC2-all.zip -d build/static + + - 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. diff --git a/.github/workflows/publish-release.yaml b/.github/workflows/publish-release.yaml new file mode 100644 index 0000000..d0e0fd8 --- /dev/null +++ b/.github/workflows/publish-release.yaml @@ -0,0 +1,27 @@ +name: Publish release + +on: + workflow_dispatch: + push: + tags: + - '*' + +jobs: + publish-release: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 #v4.1.7 + with: + # See https://github.com/cli/cli/issues/9558 + ref: ${{ github.ref }} + - 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 + env: + LIBRARIAN_SONATYPE_USERNAME: ${{ secrets.LIBRARIAN_SONATYPE_USERNAME }} + LIBRARIAN_SONATYPE_PASSWORD: ${{ secrets.LIBRARIAN_SONATYPE_PASSWORD }} + LIBRARIAN_SIGNING_PRIVATE_KEY: ${{ secrets.LIBRARIAN_SIGNING_PRIVATE_KEY }} + LIBRARIAN_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.LIBRARIAN_SIGNING_PRIVATE_KEY_PASSWORD }} + GH_TOKEN: ${{ github.token }} \ No newline at end of file diff --git a/.github/workflows/publish-snapshot.yaml b/.github/workflows/publish-snapshot.yaml new file mode 100644 index 0000000..9faeb43 --- /dev/null +++ b/.github/workflows/publish-snapshot.yaml @@ -0,0 +1,20 @@ +name: Publish snapshot + +on: + push: + branches: [ main ] +jobs: + publish-snapshot: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 #v4.1.7 + - uses: gradle/actions/setup-gradle@dbbdc275be76ac10734476cc723d82dfe7ec6eda #v3.4.2 + - run: | + ./gradlew librarianPublishToSnapshots + LIBRARIAN_VERSION_SHA1=$GITHUB_REF ./gradlew librarianPublishToGcs + env: + LIBRARIAN_SONATYPE_USERNAME: ${{ secrets.LIBRARIAN_SONATYPE_USERNAME }} + LIBRARIAN_SONATYPE_PASSWORD: ${{ secrets.LIBRARIAN_SONATYPE_PASSWORD }} + LIBRARIAN_SIGNING_PRIVATE_KEY: ${{ secrets.LIBRARIAN_SIGNING_PRIVATE_KEY }} + LIBRARIAN_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.LIBRARIAN_SIGNING_PRIVATE_KEY_PASSWORD }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml deleted file mode 100644 index b4fc292..0000000 --- a/.github/workflows/release.yaml +++ /dev/null @@ -1,19 +0,0 @@ -name: release - -on: - push: - tags: - - '*' -jobs: - release: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 #v4.1.7 - - run: | - ./gradlew librarianPublishToStaging - env: - LIBRARIAN_SONATYPE_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} - LIBRARIAN_SONATYPE_USERNAME: ${{ secrets.OSSRH_USER }} - LIBRARIAN_SIGNING_PRIVATE_KEY: ${{ secrets.GPG_KEY }} - LIBRARIAN_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.GPG_KEY_PASSWORD }} diff --git a/.github/workflows/snapshot.yaml b/.github/workflows/snapshot.yaml deleted file mode 100644 index c7a71f2..0000000 --- a/.github/workflows/snapshot.yaml +++ /dev/null @@ -1,18 +0,0 @@ -name: snapshot - -on: - push: - branches: [ main ] -jobs: - snapshot: - runs-on: macos-latest - - steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 #v4.1.7 - - run: | - ./gradlew librarianPublishToSnapshots - env: - LIBRARIAN_SONATYPE_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} - LIBRARIAN_SONATYPE_USERNAME: ${{ secrets.OSSRH_USER }} - LIBRARIAN_SIGNING_PRIVATE_KEY: ${{ secrets.GPG_KEY }} - LIBRARIAN_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.GPG_KEY_PASSWORD }} diff --git a/build.gradle.kts b/build.gradle.kts index 0f27e83..99cd484 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,8 +1,14 @@ import com.gradleup.librarian.gradle.Librarian plugins { - id("org.jetbrains.kotlin.jvm").version("2.0.0").apply(false) - id("com.gradleup.librarian").version("0.0.7-SNAPSHOT-2707254bba17a35aa7ad75ca9c151f36256f07c0").apply(false) + id("base") // Unused +} + +buildscript { + dependencies { + classpath(libs.kotlin.gradle.plugin) + classpath(libs.librarian.gradle.plugin) + } } Librarian.root(project) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index ab6517e..b044d69 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -19,4 +19,8 @@ jsonpathkt = "com.eygraber:jsonpathkt-kotlinx:3.0.2" mockserver = "com.apollographql.mockserver:apollo-mockserver:0.0.3" bouncycastle-prov = "org.bouncycastle:bcprov-jdk18on:1.78.1" bouncycastle-pg = "org.bouncycastle:bcpg-jdk18on:1.78.1" -google-auth = "com.google.auth:google-auth-library-oauth2-http:1.19.0" \ No newline at end of file +google-auth = "com.google.auth:google-auth-library-oauth2-http:1.19.0" + +librarian-gradle-plugin = "com.gradleup.librarian:librarian-gradle-plugin:0.0.7-SNAPSHOT" +kotlin-gradle-plugin = "org.jetbrains.kotlin:kotlin-gradle-plugin:2.0.21" + diff --git a/librarian-gradle-plugin/src/main/kotlin/com/gradleup/librarian/gradle/internal/task/GenerateStaticContentTask.kt b/librarian-gradle-plugin/src/main/kotlin/com/gradleup/librarian/gradle/internal/task/GenerateStaticContentTask.kt index eb4b4dd..0f1b1cd 100644 --- a/librarian-gradle-plugin/src/main/kotlin/com/gradleup/librarian/gradle/internal/task/GenerateStaticContentTask.kt +++ b/librarian-gradle-plugin/src/main/kotlin/com/gradleup/librarian/gradle/internal/task/GenerateStaticContentTask.kt @@ -26,7 +26,7 @@ internal abstract class GenerateStaticContentTask: DefaultTask() { if (source.file.isDirectory) { return@visit } - base.resolve("repository").resolve(source.path).let { destination -> + base.resolve("m2").resolve(source.path).let { destination -> destination.parentFile.mkdirs() source.file.copyTo(destination) }