Skip to content

Commit

Permalink
Merge pull request #31 from paug/librarian
Browse files Browse the repository at this point in the history
Replace our custom publication logic with librarian
  • Loading branch information
martinbonnin authored Jul 12, 2024
2 parents 2501dfc + f1b2446 commit 3fba78f
Show file tree
Hide file tree
Showing 22 changed files with 146 additions and 352 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/build-pull-request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Build pull request

on: pull_request

jobs:
build-pull-request:
runs-on: macos-latest

steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 #v4.1.7
- run: |
./gradlew build
27 changes: 0 additions & 27 deletions .github/workflows/ci.yaml

This file was deleted.

41 changes: 41 additions & 0 deletions .github/workflows/publish-docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Publish documentation

on:
push:
branches: ["main"]
workflow_dispatch:

env:
INSTANCE: 'Writerside/doc'
ARTIFACT: 'webHelpDOC2-all.zip'
DOCKER_VERSION: '241.16003'

jobs:
build-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 #v4.1.7
with:
fetch-depth: 0

- name: Prepare static content
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
- name: Deploy Kdoc to github pages
uses: JamesIves/github-pages-deploy-action@5c6e9e9f3672ce8fd37b9856193d2a537941e66c #v4.6.1
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
with:
name: docs
path: |
artifacts/${{ env.ARTIFACT }}
retention-days: 7
23 changes: 23 additions & 0 deletions .github/workflows/publish-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Publish release

on:
workflow_dispatch:
push:
tags:
- '*'

jobs:
publish-release:
runs-on: macos-latest

steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 #v4.1.7
- 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 }}
18 changes: 18 additions & 0 deletions .github/workflows/publish-snapshot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Publish snapshot

on:
push:
branches: [ main ]
jobs:
publish-snapshot:
runs-on: macos-latest

steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 #v4.1.7
- run: |
./gradlew librarianPublishToMavenSnapshots
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 }}
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Next version (unreleased)

Bugfixes and performance improvements!
2 changes: 1 addition & 1 deletion build-logic/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ repositories {

dependencies {
implementation(gradleApi())
implementation(libs.mbonnin.vespene)
implementation(libs.librarian)
implementation(libs.jetbrains.kotlinx.coroutines)
implementation(libs.android.gradle.plugin)
implementation(libs.jetbrains.kotlin.gradle.plugin)
Expand Down
17 changes: 0 additions & 17 deletions build-logic/src/main/kotlin/EnvVarKeys.kt

This file was deleted.

5 changes: 0 additions & 5 deletions build-logic/src/main/kotlin/accessors.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ inline fun <reified T> Project.extension(): T {
return extensionOrNull<T>() ?: error("No extension of type '${T::class.java.name}")
}

inline fun <reified T> Project.extension(block: T.() -> Unit) {
extension<T>().apply(block)
}


val KotlinMultiplatformExtension.compose: ComposePlugin.Dependencies
get() {
return (this as ExtensionAware).extensions.getByName("compose") as ComposePlugin.Dependencies
Expand Down
221 changes: 0 additions & 221 deletions build-logic/src/main/kotlin/internal/Publishing.kt

This file was deleted.

Loading

0 comments on commit 3fba78f

Please sign in to comment.