From d2d6db2d11a87be1a498f4bb1602ca1292b637ce Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 8 Jul 2026 10:49:23 +0000 Subject: [PATCH 1/2] Document Gradle Groovy DSL usage and clarify GitHub Packages auth Add a build.gradle (Groovy) example alongside the existing build.gradle.kts one, and clarify that GitHub Packages needs a PAT with read:packages scope, not an account password. --- README.md | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 60d89ce..b5f177c 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,16 @@ Compiled targeting Java 25 bytecode — consumers need JDK 25+ at runtime. ## Installation -Published to GitHub Packages. Add the repository and dependency to your Gradle build: +Published to GitHub Packages. GitHub Packages requires authentication to download even from public repositories — you need a GitHub **username** and a **Personal Access Token (PAT)** with `read:packages` scope (your account password will not work). Create one under GitHub Settings → Developer settings → Personal access tokens, then export it rather than hardcoding it: + +```bash +export GITHUB_ACTOR= +export GITHUB_TOKEN= +``` + +Add the repository and dependency to your Gradle build. + +**Kotlin DSL (`build.gradle.kts`):** ```kotlin repositories { @@ -41,7 +50,23 @@ dependencies { } ``` -GitHub Packages requires authentication even for public repositories, so consumers need a token with `read:packages` scope. +**Groovy DSL (`build.gradle`):** + +```groovy +repositories { + maven { + url = uri("https://maven.pkg.github.com/codeyogico/micronaut-httpclient2curl") + credentials { + username = System.getenv("GITHUB_ACTOR") + password = System.getenv("GITHUB_TOKEN") // needs read:packages scope + } + } +} + +dependencies { + implementation "com.codeyogico:micronaut-httpclient2curl:" +} +``` ## Configuration From ecd1669f30c35b6d9abd2c2e36f24d9b9ff3d72e Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 8 Jul 2026 11:00:53 +0000 Subject: [PATCH 2/2] Switch distribution from GitHub Packages to JitPack MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit JitPack lets consumers add this as a normal Gradle dependency with zero credentials (like mavenCentral()), building on demand from GitHub tags/ releases. Drop the GitHub Packages publish workflow and repository config (no longer needed — JitPack requires no CI publish step) and update the README installation instructions accordingly. Verified `gradlew build` and `gradlew publishToMavenLocal` still succeed with the simplified maven-publish config JitPack relies on. --- .github/workflows/publish.yml | 34 ---------------------------------- README.md | 33 ++++++++------------------------- build.gradle.kts | 12 +----------- 3 files changed, 9 insertions(+), 70 deletions(-) delete mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index 01460b4..0000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Publish - -on: - release: - types: [published] - -permissions: - contents: read - packages: write - -jobs: - publish: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Set up JDK 25 - uses: actions/setup-java@v4 - with: - distribution: temurin - java-version: '25' - - - name: Grant execute permission for gradlew - run: chmod +x gradlew - - - name: Resolve version from release tag - id: version - run: echo "value=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT" - - - name: Publish to GitHub Packages - run: ./gradlew publish -PpublishVersion=${{ steps.version.outputs.value }} - env: - GITHUB_ACTOR: ${{ github.actor }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.md b/README.md index b5f177c..3984835 100644 --- a/README.md +++ b/README.md @@ -23,30 +23,17 @@ Compiled targeting Java 25 bytecode — consumers need JDK 25+ at runtime. ## Installation -Published to GitHub Packages. GitHub Packages requires authentication to download even from public repositories — you need a GitHub **username** and a **Personal Access Token (PAT)** with `read:packages` scope (your account password will not work). Create one under GitHub Settings → Developer settings → Personal access tokens, then export it rather than hardcoding it: - -```bash -export GITHUB_ACTOR= -export GITHUB_TOKEN= -``` - -Add the repository and dependency to your Gradle build. +Published via [JitPack](https://jitpack.io) — no credentials needed, same as `mavenCentral()`. JitPack builds the jar on demand straight from this repo's GitHub tags/releases. **Kotlin DSL (`build.gradle.kts`):** ```kotlin repositories { - maven { - url = uri("https://maven.pkg.github.com/codeyogico/micronaut-httpclient2curl") - credentials { - username = System.getenv("GITHUB_ACTOR") - password = System.getenv("GITHUB_TOKEN") // needs read:packages scope - } - } + maven { url = uri("https://jitpack.io") } } dependencies { - implementation("com.codeyogico:micronaut-httpclient2curl:") + implementation("com.github.codeyogico:micronaut-httpclient2curl:") } ``` @@ -54,20 +41,16 @@ dependencies { ```groovy repositories { - maven { - url = uri("https://maven.pkg.github.com/codeyogico/micronaut-httpclient2curl") - credentials { - username = System.getenv("GITHUB_ACTOR") - password = System.getenv("GITHUB_TOKEN") // needs read:packages scope - } - } + maven { url "https://jitpack.io" } } dependencies { - implementation "com.codeyogico:micronaut-httpclient2curl:" + implementation "com.github.codeyogico:micronaut-httpclient2curl:" } ``` +`` is any git tag/release (e.g. `v1.0.0`), a commit SHA, or `main-SNAPSHOT` for the latest commit on `main`. The first resolve after a new tag takes a little longer while JitPack builds it; after that it's cached. + ## Configuration Both filters are enabled by default and can be turned off independently via `application.yml`: @@ -82,4 +65,4 @@ curl-logger: ## Releasing -Publishing runs via the `Publish` GitHub Actions workflow (`.github/workflows/publish.yml`), triggered when a GitHub Release is published. The release tag (e.g. `v1.2.0`) is used as the published artifact version (`1.2.0`). +No publish step required — cut a GitHub Release (or just push a tag) and JitPack builds that version the first time someone requests it. diff --git a/build.gradle.kts b/build.gradle.kts index 3ce87cf..d1ff207 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -25,7 +25,7 @@ kotlin { } group = "com.codeyogico" -version = (findProperty("publishVersion") as String?) ?: "0.1.0-SNAPSHOT" +version = "0.1.0-SNAPSHOT" repositories { mavenLocal() @@ -72,15 +72,5 @@ publishing { from(components["java"]) } } - repositories { - maven { - name = "GitHubPackages" - url = uri("https://maven.pkg.github.com/codeyogico/micronaut-httpclient2curl") - credentials { - username = System.getenv("GITHUB_ACTOR") - password = System.getenv("GITHUB_TOKEN") - } - } - } }