From e5846f67fc825eabe75be265c80dc8dcc1c82157 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 24 Oct 2026 10:36:06 +0000 Subject: [PATCH 1/3] Publish a lowercase artifactId to GitHub Packages GitHub Packages rejects artifactIds with uppercase letters, so the same library is also published as a lowercase github publication in its own Maven layout. Maven Central keeps the existing coordinates. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01QwfmMR3bsQCfffkJXMD6m2 --- .github/workflows/ci.yml | 13 +++---- README.md | 4 +-- flowlayoutmanager/build.gradle | 62 +++++++++++++++++++--------------- gradle.properties | 4 +-- 4 files changed, 46 insertions(+), 37 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8713def..aa3cf0b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -182,7 +182,8 @@ jobs: ./gradlew \ :flowlayoutmanager:assembleRelease \ :flowlayoutmanager:publishToMavenLocal \ - :flowlayoutmanager:publishReleasePublicationToStagingRepository \ + :flowlayoutmanager:publishReleasePublicationToCentralRepository \ + :flowlayoutmanager:publishGithubPublicationToGithubRepository \ :app:assembleDebug \ :app:assembleRelease @@ -209,8 +210,8 @@ jobs: path: dist/* if-no-files-found: error - # Maven repository layout (AAR, sources, javadoc, POM and signatures), - # published as is to GitHub Packages and Maven Central + # Maven repository layouts (AAR, sources, javadoc, POM and signatures), + # published as is to Maven Central (central/) and GitHub Packages (github/) - name: Upload Maven artifacts uses: actions/upload-artifact@v7 with: @@ -319,7 +320,7 @@ jobs: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - cd maven + cd maven/github { find . -type f ! -name 'maven-metadata.xml*' | sort; find . -type f -name 'maven-metadata.xml*' | sort; } > "$RUNNER_TEMP/files" while read -r FILE; do echo "Uploading ${FILE#./}" @@ -351,13 +352,13 @@ jobs: echo "::warning::MAVEN_CENTRAL_USERNAME and MAVEN_CENTRAL_PASSWORD not configured - skip Maven Central" exit 0 fi - if ! find maven -name '*.asc' | grep -q .; then + if ! find maven/central -name '*.asc' | grep -q .; then echo "::error::Maven artifacts are not signed - configure SIGNING_KEY and SIGNING_PASSWORD" exit 1 fi # Maven Central manages maven-metadata.xml itself - (cd maven && zip -qr "$RUNNER_TEMP/bundle.zip" . -x '*maven-metadata.xml*') + (cd maven/central && zip -qr "$RUNNER_TEMP/bundle.zip" . -x '*maven-metadata.xml*') AUTH="Authorization: Bearer $(printf '%s:%s' "$CENTRAL_USERNAME" "$CENTRAL_PASSWORD" | base64 -w0)" DEPLOYMENT=$(curl --fail-with-body -sS -H "$AUTH" -F "bundle=@$RUNNER_TEMP/bundle.zip" \ "https://central.sonatype.com/api/v1/publisher/upload?name=${{ github.event.repository.name }}-$VERSION&publishingType=AUTOMATIC") diff --git a/README.md b/README.md index ace196a..49b9480 100644 --- a/README.md +++ b/README.md @@ -20,13 +20,13 @@ The library is published on Maven Central, add the dependency (remember to check ```groovy dependencies { - implementation 'io.github.simonebortolin:FlowLayoutManager:1.10.0' + implementation 'io.github.simonebortolin:FlowLayoutManager:1.11.0' } ``` It is also available on [JitPack](https://jitpack.io/#simonebortolin/FlowLayoutManager) as `com.github.simonebortolin:FlowLayoutManager` (add `maven { url "https://jitpack.io" }` to the repositories in `settings.gradle`) and on -[GitHub Packages](https://github.com/simonebortolin/FlowLayoutManager/packages), which requires a GitHub token to download. +[GitHub Packages](https://github.com/simonebortolin/FlowLayoutManager/packages) as `io.github.simonebortolin:flowlayoutmanager`, which requires a GitHub token to download. Every release also ships the `.aar` and the sample app `.apk`, with their build provenance attestation, on the [Releases page](https://github.com/simonebortolin/FlowLayoutManager/releases). diff --git a/flowlayoutmanager/build.gradle b/flowlayoutmanager/build.gradle index b58627b..ac56707 100644 --- a/flowlayoutmanager/build.gradle +++ b/flowlayoutmanager/build.gradle @@ -54,46 +54,54 @@ dependencies { afterEvaluate { publishing { publications { - release(MavenPublication) { - from components.release - artifactId = 'FlowLayoutManager' + // Same library, GitHub Packages does not accept uppercase letters in the artifactId + [release: 'FlowLayoutManager', github: 'flowlayoutmanager'].each { publicationName, publicationArtifactId -> + create(publicationName, MavenPublication) { + from components.release + artifactId = publicationArtifactId - // Metadata required by Maven Central - pom { - name = 'FlowLayoutManager' - description = 'A RecyclerView LayoutManager that lays out views in flow style.' - url = 'https://github.com/simonebortolin/FlowLayoutManager' - licenses { - license { - name = 'GNU General Public License v3.0' - url = 'https://www.gnu.org/licenses/gpl-3.0.txt' + // Metadata required by Maven Central + pom { + name = 'FlowLayoutManager' + description = 'A RecyclerView LayoutManager that lays out views in flow style.' + url = 'https://github.com/simonebortolin/FlowLayoutManager' + licenses { + license { + name = 'GNU General Public License v3.0' + url = 'https://www.gnu.org/licenses/gpl-3.0.txt' + } } - } - developers { - developer { - id = 'simonebortolin' - name = 'Simone Bortolin' - url = 'https://github.com/simonebortolin' + developers { + developer { + id = 'simonebortolin' + name = 'Simone Bortolin' + url = 'https://github.com/simonebortolin' + } + } + scm { + url = 'https://github.com/simonebortolin/FlowLayoutManager' + connection = 'scm:git:https://github.com/simonebortolin/FlowLayoutManager.git' + developerConnection = 'scm:git:ssh://git@github.com/simonebortolin/FlowLayoutManager.git' } - } - scm { - url = 'https://github.com/simonebortolin/FlowLayoutManager' - connection = 'scm:git:https://github.com/simonebortolin/FlowLayoutManager.git' - developerConnection = 'scm:git:ssh://git@github.com/simonebortolin/FlowLayoutManager.git' } } } } repositories { - // Maven layout that CI uploads to GitHub Packages and Maven Central + // Maven layouts that CI uploads to Maven Central and GitHub Packages + maven { + name = 'central' + url = layout.buildDirectory.dir('staging-deploy/central') + } maven { - name = 'staging' - url = layout.buildDirectory.dir('staging-deploy') + name = 'github' + url = layout.buildDirectory.dir('staging-deploy/github') } } } - // Signed only when CI provides the key (ORG_GRADLE_PROJECT_signingKey and signingPassword) + // Signed only when CI provides the key (ORG_GRADLE_PROJECT_signingKey and signingPassword), + // GitHub Packages does not need the signatures def signingKey = findProperty('signingKey') if (signingKey) { signing { diff --git a/gradle.properties b/gradle.properties index 7f32ee0..3702f2d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ # Version of the library and of the sample app, used by CI to tag and release. -VERSION_NAME=1.10.0 -VERSION_CODE=20 +VERSION_NAME=1.11.0 +VERSION_CODE=21 # Keep it as low as the dependencies allow, library and sample app share it. MIN_SDK=21 From 49615e0a50b82ec2575fb6c392429c1fe70572b1 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 24 Oct 2026 10:36:25 +0000 Subject: [PATCH 2/3] Release as a patch version Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01QwfmMR3bsQCfffkJXMD6m2 --- README.md | 2 +- gradle.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 49b9480..25674ec 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ The library is published on Maven Central, add the dependency (remember to check ```groovy dependencies { - implementation 'io.github.simonebortolin:FlowLayoutManager:1.11.0' + implementation 'io.github.simonebortolin:FlowLayoutManager:1.10.1' } ``` diff --git a/gradle.properties b/gradle.properties index 3702f2d..c6ce3fe 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ # Version of the library and of the sample app, used by CI to tag and release. -VERSION_NAME=1.11.0 +VERSION_NAME=1.10.1 VERSION_CODE=21 # Keep it as low as the dependencies allow, library and sample app share it. MIN_SDK=21 From 4a931d54f1779b5504731827ddc59d71fe343d4d Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 24 Oct 2026 10:38:33 +0000 Subject: [PATCH 3/3] Ship the Javadoc with the release and publish it to GitHub Pages Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01QwfmMR3bsQCfffkJXMD6m2 --- .github/workflows/ci.yml | 43 ++++++++++++++++++++++++++++++++++++++-- README.md | 4 +++- 2 files changed, 44 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aa3cf0b..9787653 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,7 +29,7 @@ env: TEST_JAVA_VERSION: '21' # Stages: Resolve Version -> Test (lowest and latest Android SDK) -> Build library & sample app -> Tag & Release -# -> Publish to GitHub Packages and Maven Central +# -> Publish to GitHub Packages and Maven Central, Javadoc to GitHub Pages # The Test report job publishes the JUnit results of every SDK, also when the tests fail. # Every stage must succeed for the next one to start. jobs: @@ -191,6 +191,8 @@ jobs: run: | mkdir -p dist cp flowlayoutmanager/build/outputs/aar/flowlayoutmanager-release.aar "dist/FlowLayoutManager-${VERSION}.aar" + cp "flowlayoutmanager/build/staging-deploy/central/io/github/simonebortolin/FlowLayoutManager/${VERSION}/FlowLayoutManager-${VERSION}-javadoc.jar" \ + "dist/FlowLayoutManager-${VERSION}-javadoc.jar" # Signed release APK when a keystore is configured, debug APK otherwise # (an unsigned APK cannot be installed). @@ -256,7 +258,7 @@ jobs: - name: Attest build provenance uses: actions/attest-build-provenance@v4 with: - subject-path: 'release/*.aar, release/*.apk, maven/**/*.aar, maven/**/*.jar, maven/**/*.pom' + subject-path: 'release/*.aar, release/*.jar, release/*.apk, maven/**/*.aar, maven/**/*.jar, maven/**/*.pom' - name: Tag release id: tag @@ -297,6 +299,43 @@ jobs: -f description="$DESCRIPTION" \ -f context="release" + pages: + name: Publish Javadoc to GitHub Pages + runs-on: ubuntu-latest + needs: [version, release] + if: needs.version.outputs.tag_exists != 'true' + permissions: + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + env: + VERSION: ${{ needs.version.outputs.version }} + + steps: + - name: Download artifacts + uses: actions/download-artifact@v8 + with: + name: flowlayoutmanager-${{ env.VERSION }} + path: release + + # Same Javadoc jar shipped with the release and on Maven Central + - name: Extract Javadoc + run: | + mkdir site + unzip -q "release/FlowLayoutManager-${VERSION}-javadoc.jar" -d site + rm -rf site/META-INF + + - name: Upload Pages artifact + uses: actions/upload-pages-artifact@v4 + with: + path: site + + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 + publish-github: name: Publish to GitHub Packages runs-on: ubuntu-latest diff --git a/README.md b/README.md index 25674ec..d7646cf 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,9 @@ It is also available on [JitPack](https://jitpack.io/#simonebortolin/FlowLayoutM (add `maven { url "https://jitpack.io" }` to the repositories in `settings.gradle`) and on [GitHub Packages](https://github.com/simonebortolin/FlowLayoutManager/packages) as `io.github.simonebortolin:flowlayoutmanager`, which requires a GitHub token to download. -Every release also ships the `.aar` and the sample app `.apk`, with their build provenance attestation, +The Javadoc of the latest release is on [GitHub Pages](https://simonebortolin.github.io/FlowLayoutManager/). + +Every release also ships the `.aar`, the Javadoc `.jar` and the sample app `.apk`, with their build provenance attestation, on the [Releases page](https://github.com/simonebortolin/FlowLayoutManager/releases). Item per line limitation