How to make a DialogOS release - dialogos-project/dialogos GitHub Wiki
The tools for making a new release of DialogOS live in the dialogos-distribution repository.
A standard release of DialogOS can be made by running the script make-release.py
. The script requires Python 3.6 or later. You also need install4jc
in your PATH.
Assuming that you have an up-to-date version of make-release.py somewhere, proceed as follows:
- Create a new directory (e.g. under /tmp) and chdir there.
- Run
python .../make-release.py
. The script will ask you for the version of the release you want to produce (e.g. 2.0.2) and the snapshot release for the next release cycle (e.g. 2.0.3-SNAPSHOT). It will also confirm that you have updated the CHANGELOG to reflect all changes you have made for your new release. - The release script will clone a number of repositories from Github, update their version numbers, and generate install4j installers for Windows, MacOS, and Linux. The output of a typical successful run is shown below. If any errors occur, the script will exit. You can look up the error messages in the logfile; its name is printed to the console by the release script.
- If the release script succeeds in building the installers, it will then push its changes to Github and tag the new source versions on Github. This will automatically create a new version of DialogOS on Jitpack. Jitpack will compile the new version once a project is compiled against it for the first time.
- Once the release script has run, go to the releases page of the DialogOS repository. Find your new release (at the top), click on the "..." button to the right, and select "Create Release". Fill in the form (with the title "DialogOS v2.0.2" and the contents of the changelog) and upload the installer files that were generated by the release script.
When you run python make-release.py
without any command-line arguments, the script will build the next release locally on your computer. It will not upload anything to the website or push any changes to Github.
To build the distribution and publish it, run
python make-release.py --publish
If you have already built the distribution and only want to publish it, run
python make-release.py --only-publish
If all goes correctly, the output of the release script should look something like this:
(py36)hilbert:dd koller$ python ~/Documents/workspace/dialogos/dialogos-distribution/make-release.py
Enter version for the release: 2.0.2
Have you updated CHANGELOG.md for version 2.0.2 [yes/no]: yes
Enter version for the next development cycle [default 2.0.3-SNAPSHOT]:
Logfile is log_2018_11_15_12:54:33.txt.
Updating and building DialogOS Core ...
Updating and building NXT plugin ...
Updating and building SQLite plugin ...
Updating and building dialogos-distribution ...
Building installers ...
Done, installers are in dialogos-distribution/install4j/generated_installers.
Please upload them to Github under the 2.0.2 release on https://github.com/dialogos-project/dialogos/tags
Tagging Git versions and pushing to Github: dialogos ...
Tagging Git versions and pushing to Github: dialogos-plugin-nxt ...
Tagging Git versions and pushing to Github: dialogos-plugin-sqlite ...
Tagging Git versions and pushing to Github: dialogos-distribution ...
Setting version of DialogOS Core to next development version (2.0.3-SNAPSHOT) ...
Updating website ...
Done.
To add new plugins to the DialogOS installer, you have to take a few extra steps.
- Add code to make-release.py that checks out and builds the plugin.
- Add the plugin to the list under "PUSH AND TAG ALL REPOSITORIES".
A new plugin usually comes with new files, both the plugin and its dependencies. These have to be added to the install4j installer definition:
- build dialogos-distribution to have all files in the correct place
- open install4j, go to files -> define distribution tree
- create a new folder for the plugin, add files needed by the plugin to that folder
- for the plugin jar itself: replace the version number in the file name with ${compiler:dialogos.version}
- go to files -> installation components, create a new component for the plugin select the corresponding directory of the plugin to be installed.
- in the dialogos.install4j file, add the new directories to the classpath by adding a
new entry under the
<classPath>
node. TODO: where is this in the GUI?
In order for a plugin to be built and packaged by the make-release script, it needs to satisfy a few conventions. (The "DO NOT EDIT" comments are optional, and you can change what they say exactly, but it is a good idea to have such a comment.)
-
In the Plugin class of the plugin, the
getVersion
method needs to be on a single line. This is so the make-release script can automatically replace the version string by the version of the release.@Override public String getVersion() { return "2.0"; } // DO NOT EDIT - This line is updated automatically by the make-release script.
-
The build.gradle file must define the version of the plugin project as follows:
def version = '2.0.1' // DO NOT EDIT - THIS IS CHANGED BY THE RELEASE SCRIPT
-
The project must have a
settings.gradle
file that defines the project name:rootProject.name = 'dialogos-plugin-googletts'
If the dependencies of either dialogos or a plugin change, you may have to adapt the installer definition, see above. Go through the relevant parts of the distribution tree and installation components and adjust as needed.
Install4j is now configured to bundle a Jetbrains JRE 11 with each installer (the LTS version of Java as of May 2021). This makes the runtime behavior of DialogOS installations more predictable, and circumvents issues of missing or unfindable Java installations.