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 60d89ce..3984835 100644 --- a/README.md +++ b/README.md @@ -23,25 +23,33 @@ 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 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.github.codeyogico:micronaut-httpclient2curl:") +} +``` + +**Groovy DSL (`build.gradle`):** + +```groovy +repositories { + maven { url "https://jitpack.io" } } dependencies { - implementation("com.codeyogico:micronaut-httpclient2curl:") + implementation "com.github.codeyogico:micronaut-httpclient2curl:" } ``` -GitHub Packages requires authentication even for public repositories, so consumers need a token with `read:packages` scope. +`` 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 @@ -57,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") - } - } - } }