From f16cd9b98cd8657670b8d048975242bc1860ecd2 Mon Sep 17 00:00:00 2001 From: Tomas Casas Date: Wed, 11 Feb 2026 17:48:14 -0300 Subject: [PATCH 1/2] Trigger automatic release to Maven Central --- .github/workflows/publish.yml | 97 ++++++++++++++++++++--------------- 1 file changed, 55 insertions(+), 42 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 17dec92..251393c 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -8,19 +8,19 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - name: Set up JDK 17 - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: 17 - - name: Build and Test with Gradle - run: ./gradlew build - - name: Upload Build Artifacts - uses: actions/upload-artifact@v4 - with: - name: build - path: sdk/build/ + - uses: actions/checkout@v4 + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + distribution: "temurin" + java-version: 17 + - name: Build and Test with Gradle + run: ./gradlew build + - name: Upload Build Artifacts + uses: actions/upload-artifact@v4 + with: + name: build + path: sdk/build/ publish: needs: build @@ -29,32 +29,45 @@ jobs: contents: read packages: write steps: - - uses: actions/checkout@v4 - - name: Set up JDK 17 - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: 17 - - name: Download Build - uses: actions/download-artifact@v4 - with: - name: build - path: sdk/build/ - - name: Import Signing Key - run: echo "${{ secrets.GPG_KEY_BASE64 }}" | base64 -d | gpg --batch --import - - name: Export Secret Key Ring - run: gpg --pinentry-mode loopback --passphrase "${{ secrets.GPG_PASSWORD }}" --export-secret-keys 0F95489EF8E0C0DA > /home/runner/.gnupg/secring.gpg - - name: Generate Gradle Properties - run: | - cat << EOF > ./gradle.properties - android.useAndroidX=true - nexusUsername=${{ secrets.NEXUS_USERNAME }} - nexusPassword=${{ secrets.NEXUS_PASSWORD }} - signing.keyId=F8E0C0DA - signing.password=${{ secrets.GPG_PASSWORD }} - signing.secretKeyRingFile=/home/runner/.gnupg/secring.gpg - EOF - - name: Publish package - run: ./gradlew publish -Pversion=${{ github.event.release.tag_name }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - uses: actions/checkout@v4 + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + distribution: "temurin" + java-version: 17 + - name: Download Build + uses: actions/download-artifact@v4 + with: + name: build + path: sdk/build/ + - name: Import Signing Key + run: echo "${{ secrets.GPG_KEY_BASE64 }}" | base64 -d | gpg --batch --import + - name: Export Secret Key Ring + run: gpg --pinentry-mode loopback --passphrase "${{ secrets.GPG_PASSWORD }}" --export-secret-keys 0F95489EF8E0C0DA > /home/runner/.gnupg/secring.gpg + - name: Generate Gradle Properties + run: | + cat << EOF > ./gradle.properties + android.useAndroidX=true + nexusUsername=${{ secrets.NEXUS_USERNAME }} + nexusPassword=${{ secrets.NEXUS_PASSWORD }} + signing.keyId=F8E0C0DA + signing.password=${{ secrets.GPG_PASSWORD }} + signing.secretKeyRingFile=/home/runner/.gnupg/secring.gpg + EOF + - name: Publish package + run: ./gradlew publish -Pversion=${{ github.event.release.tag_name }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Trigger automatic release to Maven Central + run: | + # Create base64 encoded token from nexus credentials + TOKEN=$(echo -n "${{ secrets.NEXUS_USERNAME }}:${{ secrets.NEXUS_PASSWORD }}" | base64) + + # Trigger automatic release via OSSRH Staging API + curl -X POST \ + "https://ossrh-staging-api.central.sonatype.com/manual/upload/defaultRepository/com.adzerk?publishing_type=automatic" \ + -H "Authorization: Bearer ${TOKEN}" \ + -H "Content-Type: application/json" \ + -w "\nHTTP Status: %{http_code}\n" \ + -v + continue-on-error: false From 276b1b4f3b510dda12d74a51443887dbb60c35ab Mon Sep 17 00:00:00 2001 From: Tomas Casas Date: Wed, 11 Feb 2026 17:54:51 -0300 Subject: [PATCH 2/2] Add note to check for published version Manual releasing the staged package is no longer required. --- README.md | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f52c269..7b3ebbe 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,7 @@ sdk.firePixel(clickUrl, listener); ``` Modifying the revenue + ```kotlin // Click pixel; fire when user clicks on the ad and modify the click revenue // OVERRIDE: replaces the revenue value of the click/event @@ -80,6 +81,7 @@ sdk.firePixel(clickUrl, revenue, RevenueModifierType.OVERRIDE, null, listener); ``` Setting the gross merchandise value for the event. + ```kotlin // Click pixel; fire when user clicks on the ad and modify the click revenue // OVERRIDE: replaces the revenue value of the click/event @@ -90,6 +92,7 @@ sdk.firePixel(clickUrl, revenue, RevenueModifierType.ADDITIONAL, grossMerchandis ``` Handle the fire pixel response + ```kotlin // status: HTTP status code // location: click target URL @@ -102,6 +105,7 @@ public void success(FirePixelResponse response) { ``` ## Additional Options + Additional optional parameters supported by the API may be specified via the Builder on the Request or Placement. Example: to specify eCPM partitions for a Placement: @@ -131,6 +135,7 @@ val request = new Request.Builder() ``` ## Multi-Winner Placements + A multi-winner placement returns multiple selections inside a single placement object. To request multiple winners, specify a count for the Placement object. This requests the maximum number of winners (selections) that can be included in the placement. @@ -157,24 +162,29 @@ Request request = new Request.Builder(placements) @since SDK v0.4.0+ ## Building + Use gradlew to build library archive ``` ./gradlew assemble ``` + output: `sdk/build/outputs/aar` ## Testing + Run unit tests ``` ./gradlew test --rerun-tasks ``` + Specify `--rerun-tasks` to rerun up-to-date tests. To view test reports see: output: `sdk/build/reports/tests` ## Documentation + Generate the SDK documentation ``` @@ -184,16 +194,19 @@ Generate the SDK documentation output: `sdk/build/docs/javadoc` ## Publishing + Publishing to Maven Central is automated via GitHub Actions. When a new GitHub release is created, the [publish workflow](.github/workflows/publish.yml) will build, sign, and publish the package to Sonatype OSSRH. The version is derived from the release tag name. The workflow requires the following repository secrets: + - `GPG_KEY_BASE64` - base64-encoded GPG signing key - `GPG_PASSWORD` - passphrase for the GPG key - `NEXUS_USERNAME` / `NEXUS_PASSWORD` - Sonatype OSSRH credentials +Check on https://central.sonatype.com/artifact/com.adzerk/sdk that current version matches the released one when the publish GHA has finished. + To publish to local Maven repository for testing: + ``` ./gradlew publishToMavenLocal ``` - -Login to Sonatype OSSRH, locate the staging package, and release it.