grails / grails-core

The Grails Web Application Framework
http://grails.org
Apache License 2.0
2.78k stars 951 forks source link

Document Snapshot Deployment #13571

Open codeconsole opened 1 month ago

codeconsole commented 1 month ago

Document the Requirements for Deploying to the Snapshot Repository

Discuss

  1. Should SNAPSHOTs continue to go to jfrog starting with 7.x?
  2. Should the SNAPSHOT process require different configuration from the deployment process?

Goals

  1. Configure https://github.com/gpc/export to publish to Snapshot Repository
  2. Configure https://github.com/grails/grails-boot
  3. Fix gradle.plugin is mistakenly publishing a pom under grails-core org/grails/grails-core/org.grails.grails-core.gradle.plugin/ Unwanted Artifact?

Working Snapshots grails-core grails-gradle-plugin grails-bom

Not Working grails-gsp neo-4j

From @matrei

An example of a simple module, publishing snapshots, is scaffolding. It uses the org.grails.internal.grails-plugin-publish gradle plugin from grails-gradle-plugin.

build.gradle

plugins {
    id 'java-library'
    id 'eclipse'
    id 'idea'
    id 'org.grails.grails-plugin'
    id 'org.grails.grails-gsp'
    id 'org.grails.internal.grails-plugin-publish'
}
grailsPublish {
    userOrg = "grails"
    githubSlug = 'grails/scaffolding'
    license {
        name = 'Apache-2.0'
    }
    title = "Grails Scaffolding Plugin"
    desc = "Provides scaffolding for Grails applications"
    developers = [puneetbehl: "Puneet Behl"]
}

Then, in the gradle.yml github workflow it publishes on pushevents:

publish:
    if: github.event_name == 'push'
    needs: ['build']
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Set up JDK
        uses: actions/setup-java@v4
        with:
          distribution: 'adopt'
          java-version: '11'
      - name: Publish Artifacts (repo.grails.org)
        id: publish
        uses: gradle/gradle-build-action@v3
        env:
          GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
          GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }}
          GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }}
          ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
          ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
        with:
          arguments: -Dorg.gradle.internal.publish.checksums.insecure=true publish

Where is scaffolding publishing to?

codeconsole commented 1 month ago

@matrei is scaffolding going to the right place?

matrei commented 1 month ago

@codeconsole https://repo.grails.org/ui/native/plugins3-snapshots-local/org/grails/plugins/scaffolding/

matrei commented 1 month ago

Here is where the snapshot location is specified: https://github.com/grails/grails-gradle-plugin/blob/c640157b5eaab309577981694c9e282aeab678c8/src/main/groovy/org/grails/gradle/plugin/publishing/internal/GrailsCentralPublishGradlePlugin.groovy#L335

codeconsole commented 1 month ago

ok, it goes to instead of plugins3-snapshots-locall instead of libs-snapshots-local Thanks

osscontributor commented 1 month ago

Should SNAPSHOTs continue to go to jfrog starting with 7.x?

Are SNAPSHOTs currently being published to jfrog? I believe they may only be published to Artifactory. Is that correct?

matrei commented 1 month ago

Are SNAPSHOTs currently being published to jfrog? I believe they may only be published to Artifactory. Is that correct?

@osscontributor Sorry for me perhaps being ignorant, but isn't JFrog a company, and Artifactory their product for publishing and hosting artifacts? If so, in the context of this discussion, doesn't these two terms mean the same thing?

codeconsole commented 1 month ago

@osscontributor Sorry for me perhaps being ignorant, but isn't JFrog a company, and Artifactory their product for publishing and hosting artifacts? If so, in the context of this discussion, doesn't these two terms mean the same thing?

that what I thought, but now I am confused.

codeconsole commented 1 month ago

Looks like Neo 4j neglected and not deploying snapshots: https://github.com/grails/gorm-neo4j/issues/603#issuecomment-2265960457