From b30ebfad60348bdfd73d1660679a9d4cd9121adb Mon Sep 17 00:00:00 2001 From: nicholasdoglio Date: Sat, 27 Apr 2024 17:33:02 -0400 Subject: [PATCH] Setup publishing --- .github/workflows/release.yml | 31 +++++++++++++++++++++++++++++++ .github/workflows/snapshot.yml | 14 ++++++++++++++ CHANGELOG.md | 6 ++++++ build.gradle.kts | 1 + gradle.properties | 16 ++++++++++++++++ gradle/libs.versions.toml | 1 + lint/anvil/build.gradle.kts | 1 + lint/anvil/gradle.properties | 12 ++++++++++++ lint/dagger/build.gradle.kts | 1 + lint/dagger/gradle.properties | 12 ++++++++++++ lint/hilt/build.gradle.kts | 1 + lint/hilt/gradle.properties | 12 ++++++++++++ 12 files changed, 108 insertions(+) create mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/snapshot.yml create mode 100644 lint/anvil/gradle.properties create mode 100644 lint/dagger/gradle.properties create mode 100644 lint/hilt/gradle.properties diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..fca7e9f5 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,31 @@ +name: release + +on: + push: + tags: + - '**' + +jobs: + release: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 + - uses: ./.github/actions/setup + + - run: ./gradlew publish + env: + ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }} + ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }} + ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.ARTIFACT_SIGNING_PRIVATE_KEY }} + + - name: Extract release notes + id: release_notes + uses: ffurrer2/extract-release-notes@v1 + + - name: Create release + uses: softprops/action-gh-release@v1 + with: + body: ${{ steps.release_notes.outputs.release_notes }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml new file mode 100644 index 00000000..b499617c --- /dev/null +++ b/.github/workflows/snapshot.yml @@ -0,0 +1,14 @@ +name: snapshot + +on: + push: + tags: + - '**' + +jobs: + release: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 + - uses: ./.github/actions/setup diff --git a/CHANGELOG.md b/CHANGELOG.md index 11bddf32..156808d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,3 +6,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] + +### Added + +#### Three lint artifacts! +- Anvil Lint rules! + - `ContributesBindingOverBinds`: Suggests using diff --git a/build.gradle.kts b/build.gradle.kts index 2a804a2a..4cfd9c25 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -10,6 +10,7 @@ plugins { alias(libs.plugins.kotlin.android) apply false alias(libs.plugins.kotlin.kapt) apply false alias(libs.plugins.hilt) apply false + alias(libs.plugins.publish) apply false alias(libs.plugins.doctor) alias(libs.plugins.dependencyAnalysis) } diff --git a/gradle.properties b/gradle.properties index a1e75214..fbcc7b5d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,6 +7,22 @@ org.gradle.parallel=true org.gradle.caching=true org.gradle.configureondemand=true org.gradle.configuration-cache=true +# POM +SONATYPE_HOST=DEFAULT +RELEASE_SIGNING_ENABLED=true +GROUP=dev.whosnickdoglio +VERSION_NAME=0.1.0-SNAPSHOT +POM_INCEPTION_YEAR=2023 +POM_URL=https://github.com/WhosNickDoglio/dagger-rules/ +POM_SCM_URL=https://github.com/WhosNickDoglio/dagger-rules/ +POM_SCM_CONNECTION=scm:git:git@github.com:WhosNickDoglio/dagger-rules.git +POM_SCM_DEV_CONNECTION=scm:git@github.com:WhosNickDoglio/dagger-rules.git +POM_LICENCE_NAME=The MIT License +POM_LICENCE_URL=https://opensource.org/license/mit/ +POM_LICENCE_DIST=repo +POM_DEVELOPER_ID=WhosNickDoglio +POM_DEVELOPER_NAME=Nicholas Doglio +POM_DEVELOPER_URL=https://github.com/WhosNickDoglio/ org.gradle.kotlin.dsl.allWarningsAsErrors=true android.useAndroidX=true diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 8ed686ed..d3615b07 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -21,6 +21,7 @@ dependencyAnalysis = { id = "com.autonomousapps.dependency-analysis", version = kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } kotlin-kapt = { id = "org.jetbrains.kotlin.kapt", version.ref = "kotlin" } +publish = { id = "com.vanniktech.maven.publish", version = "0.28.0" } kover = { id = "org.jetbrains.kotlinx.kover", version.ref = "kover" } ksp = { id = "com.google.devtools.ksp", version = "2.0.0-1.0.23" } sortDependencies = { id = "com.squareup.sort-dependencies", version.ref = "sort" } diff --git a/lint/anvil/build.gradle.kts b/lint/anvil/build.gradle.kts index 6ad1f8de..ef965a83 100644 --- a/lint/anvil/build.gradle.kts +++ b/lint/anvil/build.gradle.kts @@ -5,6 +5,7 @@ plugins { id("dev.whosnickdoglio.lint") alias(libs.plugins.ksp) + alias(libs.plugins.publish) } dependencies { diff --git a/lint/anvil/gradle.properties b/lint/anvil/gradle.properties new file mode 100644 index 00000000..24ed207b --- /dev/null +++ b/lint/anvil/gradle.properties @@ -0,0 +1,12 @@ +# +# Copyright (C) 2024 Nicholas Doglio +# SPDX-License-Identifier: MIT +# + +POM_ARTIFACT_ID=dagger-rules-lint +POM_NAME=Dagger Rules Lint Checks +POM_DESCRIPTION=Dagger Rules Lint Checks + +# Kotlin adds the stdlib dep by default in 1.4.0+, but that's not really allowed in lint jars. This +# disables that behavior for now +kotlin.stdlib.default.dependency=false diff --git a/lint/dagger/build.gradle.kts b/lint/dagger/build.gradle.kts index 6ad1f8de..ef965a83 100644 --- a/lint/dagger/build.gradle.kts +++ b/lint/dagger/build.gradle.kts @@ -5,6 +5,7 @@ plugins { id("dev.whosnickdoglio.lint") alias(libs.plugins.ksp) + alias(libs.plugins.publish) } dependencies { diff --git a/lint/dagger/gradle.properties b/lint/dagger/gradle.properties new file mode 100644 index 00000000..24ed207b --- /dev/null +++ b/lint/dagger/gradle.properties @@ -0,0 +1,12 @@ +# +# Copyright (C) 2024 Nicholas Doglio +# SPDX-License-Identifier: MIT +# + +POM_ARTIFACT_ID=dagger-rules-lint +POM_NAME=Dagger Rules Lint Checks +POM_DESCRIPTION=Dagger Rules Lint Checks + +# Kotlin adds the stdlib dep by default in 1.4.0+, but that's not really allowed in lint jars. This +# disables that behavior for now +kotlin.stdlib.default.dependency=false diff --git a/lint/hilt/build.gradle.kts b/lint/hilt/build.gradle.kts index 6ad1f8de..ef965a83 100644 --- a/lint/hilt/build.gradle.kts +++ b/lint/hilt/build.gradle.kts @@ -5,6 +5,7 @@ plugins { id("dev.whosnickdoglio.lint") alias(libs.plugins.ksp) + alias(libs.plugins.publish) } dependencies { diff --git a/lint/hilt/gradle.properties b/lint/hilt/gradle.properties new file mode 100644 index 00000000..754c9f70 --- /dev/null +++ b/lint/hilt/gradle.properties @@ -0,0 +1,12 @@ +# +# Copyright (C) 2024 Nicholas Doglio +# SPDX-License-Identifier: MIT +# + +POM_ARTIFACT_ID=hilt-lint +POM_NAME=Hilt Lint rules +POM_DESCRIPTION=Static Analysis checks for Hilt + +# Kotlin adds the stdlib dep by default in 1.4.0+, but that's not really allowed in lint jars. This +# disables that behavior for now +kotlin.stdlib.default.dependency=false