Skip to content

Publishing GitHub packages #748

@lemire

Description

@lemire

Currently, we are not publishing GitHub packages. They allow convenient access to the library.

Reference: Publishing Java packages with Gradle: You can use Gradle to publish Java packages to a registry as part of your continuous integration (CI) workflow. See specifically publishing packages to GitHub packages.

The process seemingly succeeds

https://github.com/RoaringBitmap/RoaringBitmap/actions/runs/11467971844

but we cannot see any package.

Help is invited.

We have added the following workflow which should publish GitHub packages when we issue a new release...

name: Publish package to GitHub Packages
on:
  release:
    types: [created]
jobs:
  publish:
    runs-on: ubuntu-latest
    permissions:
      contents: read
      packages: write
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-java@v4
        with:
          java-version: '11'
          distribution: 'temurin'
      - name: Setup Gradle
        uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0
      - name: Build with Gradle
        run: ./gradlew assemble
      - name: Publish package
        run: ./gradlew publish
        env:
          GITHUB_USER: ${{ github.actor }}
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Our gradle configuration...

plugins {
    id("maven-publish")
}


subprojects {
    apply(plugin = "java-library")
    apply(plugin = "maven-publish")
    publishing {
        repositories {
            maven {
                name = "GitHubPackages"
                url = uri("https://maven.pkg.github.com/RoaringBitmap/RoaringBitmap")
                credentials {
                    username = System.getenv("GITHUB_ACTOR")
                    password = System.getenv("GITHUB_TOKEN")
                }
            }
        }
    }
}

Please see also #749

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions