Publishing
This guide describes the process of publishing all JVM artefacts on Maven Central as well as publishing the web runtime on npmjs.org.
One-time preparation
First you will need an account on npmjs.com and need to join the materna-se organization.
Then you execute npm login and enter your credentials in the prompt.
You will also need a Sonatype Jira Account to be able to publish to Maven Central.
It will have to be activated for the groupId com.github.materna-se as seen in the following ticket: https://issues.sonatype.org/browse/OSSRH-55108.
Talk to Jonas Tamimi for details.
While you are waiting for the activation, you can generate a personalized GPG key.
To do that, follow steps 8-10 of the "Prerequisite Steps" of this guide: https://dzone.com/articles/publish-your-artifacts-to-maven-central.
Make sure to remember the Key ID from the line key 27835B3BD2A2061F marked as ultimately trusted.
Afterwards, perform step 7 of the "Publishing Steps" where you upload your public key to a key server.
To make sure that the FeGen gradle project finds your key, you need to have the following lines in the file .gradle/gradle.properties within your home directory:
mavenCentral.username=your_sonatype_org_username
mavenCentral.password=your_sonatype_org_password
signing.keyId=02468ACE
signing.secretKeyRingFile=/home/clemens/.gradle/secring.gpg
The last value points to a file within a directory, where you will have to execute the following command to save your GPG key:
gpg --export-secret-keys -o secring.gpg
The second to last value must be the ID of the key you generated earlier.
Publishing
- Increment all Versions
First you will need to increment the version of all maven artifacts and, if applicable, of the web runtime. The first ones reside in the top levelbuild.gradlefile. I strongly recommend setting all versions here on the same value and thereby accepting also publishing artifacts without changes. The version of the web runtime can be adjusted in the filefegen-web/fegen-web-runtime/package.json. It is important to also adapt all references to FeGen versions. They can be located in the variousbuild.gradlefiles as well as in the documentation within thebookdirectory. You can use the global (project wide) search to look for the old versions. Afterwards, you will need to rebuild the book (Execute./mdbook buildin/book, see Architecture). When you are done, commit your changes. - Execute Maven Publish
Execute./gradlew publishin your root directory. A dialog will pop up where you will need to enter the password for your GPG key. - Confirm Upload to Maven Central
The uploaded files of thepublishtask will end up here. Log in using the button in the top right and click onStaging Repositorieson the left. Your upload should be in the list, and you can check whether all files have been successfully uploaded. Then you can select each uploaded artifact and clickCloseandReleaseon the toolbar. - Publishing the Web Runtime
Executenpm publishinfegen-web/fegen-web-runtime. - Merging into the main branch
Themasterbranch should always represent the current state. That is why you should merge thedevelopbranch into it using--no-ff. - Tagging
Tag the commit created by the merge with the version number of the Maven artifacts and the version of the web runtime. - Switch back to develop
To prevent accidentally committing on themasterbranch, it is best to immediately switch back todevelop.