jruby-gradle/jruby-gradle-plugin

Publish the plugin to the Gradle Plugin Portal

boris-petrov opened this issue · 9 comments

Bintray+JCenter is being terminated so the path forward would be to use Maven Central (at least for now - we're still waiting on official information from the Gradle team). There is a nice summary on what must be done here.

No, these plugins should be published directly to the Gradle Plugin Portal

Or that, yes. Not sure if there are any limitations to that. If you manage to do it and want to write the steps down, please share it here. Thanks!

I know how to do that, but there are some process decisions to be made.

  1. How is going to own the portal account and keys. Although I can do that I fee that the JRuby team is better suited to this. (@headius ?)
  2. I am waiting to see what the Gradle team is going to work out about migrating older artifacts that were using the Bintray sync mechanism.

JRuby team would be the right group to own these credentials but we need some help managing this plugin.

@rtyler First thing is to recover the credentials to publish to Gradle portal, once you have that then we can add them as protected variables in GH and use a GH Actions to publish

PUBLISH_KEY and PUBLISH_SECRET added to GitHub Actions. Would that be enough to help you take this from here @ysb33r ?

@rtyler I made a bunch of progress, but it is curretnly failing with

Execution failed for task ':jruby-gradle-core-plugin:publishPlugins'.
> Unauthorized!
    Login from command line using:
      gradle login
    or login and download user API keys on:
      https://plugins.gradle.org/user/login

(https://github.com/jruby-gradle/jruby-gradle-plugin/runs/2487940190?check_suite_focus=true)

I'm not sure yet whether the credentials are incorrect or whether they are not passed in correctly in the publish job.

Maybe someone with more GHA-fu can confirm whether the repository secrets are being used correctly:

publish:
runs-on: ubuntu-latest
# on:
# push:
# branches:
# - release
needs: build
if: ${{ github.repository == 'jruby-gradle/jruby-gradle-plugin' && github.ref == 'refs/heads/release' }}
steps:
- uses: actions/checkout@v1
- uses: actions/setup-java@v1
with:
java-version: 8
- name: Cache .gradle/caches
uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-cache-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle-cache-
- name: Cache .gradle/wrapper
uses: actions/cache@v1
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle-wrapper-
- name: Publish to Gradle Portal
uses: eskatos/gradle-command-action@v1
env:
PUBLISH_KEY: ${{ secrets.PUBLISH_KEY }}
PUBLISH_SECRET: ${{ secrets.PUBLISH_SECRET }}
with:
arguments: -i --console=plain --no-build-cache assemble publishPlugins -Dgradle.publish.key=$PUBLISH_KEY -Dgradle.publish.secret=$PUBLISH_SECRET
- name: Publish documentation
uses: eskatos/gradle-command-action@v1
env:
GH_PAGES_PUSH_USER: ${{ secrets.GH_PAGES_PUSH_USER }}
GH_PAGES_PUSH_TOKEN: ${{ secrets.GH_PAGES_PUSH_TOKEN }}
with:
arguments: -i --console=plain --no-build-cache docs:publishGhPages -Dorg.ajoberstar.grgit.auth.username=$GH_PAGES_PUSH_USER -Dorg.ajoberstar.grgit.auth.password=$GH_PAGES_PUSH_TOKEN -Dorg.ajoberstar.grgit.auth.force=hardcoded

I am looking at getting a release out. What is the status here?

Actually, I'm not sure. I believe it is resolved - that is, the latest version is using the Gradle Plugin Portal and Maven Central for repositories - I don't see JCenter anywhere. So I think this can be closed!