Skip to content

Commit

Permalink
deploy to Gcs on commit
Browse files Browse the repository at this point in the history
  • Loading branch information
martinbonnin committed Nov 3, 2024
1 parent 6a2d6d5 commit dfa76a8
Show file tree
Hide file tree
Showing 10 changed files with 110 additions and 53 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/build-pull-request.yaml
Original file line number Diff line number Diff line change
@@ -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
12 changes: 0 additions & 12 deletions .github/workflows/pr.yaml

This file was deleted.

36 changes: 36 additions & 0 deletions .github/workflows/publish-pages-with-writerside.yaml
Original file line number Diff line number Diff line change
@@ -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.
27 changes: 27 additions & 0 deletions .github/workflows/publish-release.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
20 changes: 20 additions & 0 deletions .github/workflows/publish-snapshot.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
19 changes: 0 additions & 19 deletions .github/workflows/release.yaml

This file was deleted.

18 changes: 0 additions & 18 deletions .github/workflows/snapshot.yaml

This file was deleted.

10 changes: 8 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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)
6 changes: 5 additions & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
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"

Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit dfa76a8

Please sign in to comment.