Skip to content

internal_howto_release

etienne-sf edited this page Mar 26, 2021 · 27 revisions

Introduction

This page is more an internal howto, to remind of the step to:

  • Release the Maven plugin
  • Release the Gradle plugin
  • Publish the project web site, as publishing a site is really complex, from the maven-site-plugin, to the github configuration to use a specific domain, through the issue of the multi-module stuff.

And of course, if it can be useful for anyone to publish a site, then, it's nice! :)

Before publishing:

  • Check that the user has access on the owner of the git repository, as the last step works only if connected on githib with the owner of the repository.

  • Check the TODO list: some done work may still be on the TODO list.

  • Update the CHANGELOG.md:

    • Check the version for the updates being released
    • Check that all the done job is described

HowTo release the Maven Plugin

Execute to execute the release on GitHub:

mvn release:clean release:prepare

Take care to:

  • Give the proper version for the release
  • Let the default value for the tag (so that all tags look the same)
  • Give local-SNAPSHOT as the next version. This allows very easy comparison between the commits in git

Then, in order to publish the release toward the maven central repository:

mvn release:perform

Once this command succeeds, the maven plugin should be stored in the OSSRH repository, waiting to be replicated into the central repository. This can be checked by browsing into it: https://repo1.maven.org/maven2/com/graphql-java-generator/graphql-maven-plugin/.

At the end of the process, the plugin should be available https://mvnrepository.com/artifact/com.graphql-java-generator/graphql-maven-plugin. This last step can be long (up to several hours).

How to release the Gradle Plugin

  1. You'll first have to change the plugin's version:
  • Open the graphql-gradle-plugin/common_conf.gradle file
  • Change the project version to the plugin's version to publish. The Maven plugin of this version must be available in maven repository (either local or central)
  1. Adapt the plugin code, if things have changed due to changed in the plugin-logic module

  2. Copy the code and resources for the samples, from the maven project:

From the root of the Gradle project, execute:

gradlew copySamplesFromMavenPlugin

In order to make this command work, you need to update the .gradle/gradle.properties file, and add these lines:

systemProp.http.proxyHost=...
systemProp.http.proxyPort=...
systemProp.https.proxyHost=...
systemProp.https.proxyPort=...

# Properties for the graphql-gradle-plugin-project project
systemProp.graphqlGradlePlugin.graphqlMavenPluginProject.path=path_of/graphql-maven-plugin-project

# Gradle publish keys for the https://plugins.gradle.org site, for graphql-java-generator
gradle.publish.key=...
gradle.publish.secret=...
  1. [not always] Adapt the dependencies version(see the graphql-gradle-plugin/common_conf.gradle file)

  2. [not always] Adapt the build.gradle files, for instance if some plugin options have changed in the samples

  3. Build the whole project

From the root of the Gradle project, execute:

gradlew clean

Then

gradlew build

(the gradlew clean build doesn't seem to work)

  1. Create and push the git tag

You can copy/paste what's changed in the tag comment

  1. Publish the plugin

From the graphql-gradle-plugin folder, execute:

gradlew publishPlugins

HowTo publish the site

Configuring the domain name

The standard way of publishing a web site on github, is to push the site on the gh-pages branch of the project. Then, check the settings of the project. At this stage, the project site is available at this URL: https://graphql-java-generator.github.io/graphql-maven-plugin-project/.

It's possible to define a custom domain in the settings.

On the DNS configuration for the graphql-java-generator.com domain, let's add this line:

graphql-maven-plugin-project 1800 IN CNAME graphql-java-generator.github.io.

And in the settings, define the Custom domain to be: graphql-maven-plugin-project.graphql-java-generator.com

Then, the project site is available at https://graphql-maven-plugin-project.graphql-java-generator.com with the site published on the gh-pages branch of the project.

Generating the site

The use of maven-site-plugin is complex, but well described.

Here are the steps to execute:

  • cd target/checkout
    • This allows to go to the just performed release, and get all the code in the relevant version
  • publish_site which is a Windows command file, that wraps:
    • mvn antrun:run -Prelease
    • git push

This script asks for the release version. But it seems that this entry is not taken into account. Only the project version is used.

Thanks to the CNAME file being preserved, in the ant file, the custom domain configuration should not disappear... But it may be worth a check, to get to the settings of the project, to restore the custom domain, which is graphql-maven-plugin-project.graphql-java-generator.com

Clone this wiki locally