-
Notifications
You must be signed in to change notification settings - Fork 782
Creating a new release for xmage
This documents describes the steps that a developer has to do, to release a new public version of XMage (to create a private release you only need to do the "Build a new package" step). It distinguishes technically between a minor and a major release change. Minor release changes can be used if no changes are done concerning the interfaces of the client and server part of xmage. A major release prevents the usage of older clients with another major release number, so problems with that are prevented. Otherwise there are no fixed rules when and why to do minor or major releases.
This part describes what to to on the development side, to create a new release.
Change the version information in MageVersion.java. Normally MAGE_VERSION_PATCH for a major and MAGE_VERSION_MINOR_PATCH for a minor patch.
The file CardRepository.java includes the CARD_CONTENT_VERSION number, that should be increased by 1, if the released version has a changed set of cards (nomally cards were added). So if the client connects to the new server version, he can request the updated card DB content and the client card editor is showing all available cards.
The file CardRepository.java includes also a CARD_DB_VERSION number, that needs to be increased, if the db structure of the cards DB was changed. That only happens rarely.
ONLY NEEDED FOR MAJOR RELEASE
For this change one can use the pearl script version-bump. If executed it shows the current version number (e.g. "1.4.32") and you are requested to enter the new major version number (e.g. "1.4.33"). The script than automatically updated all the pom.xml files of all projects with the new number.
First take care, that the client db/cards.h2.mv.db file is created/updated with the version you want to release. The current version will be used in the created zip release file for the client part and should be therefore up-to-date. If it's missing the users can't use the deck editor until they connected to a server then. Not actual after v33 release - db-files auto-cleanups on new major releases and users must connects to any server. Use the pearl script build-and-package to create a new release zip file. If the script was executed without errors, the new release zip file is saved to your local project directory with the name "xmage.zip".
Create a new release tag with the new release number with a name in the form "xmage_1.4.32V0". The "1.4.32" means the major release number and the "0" behind the "V" indicates the minor release number. This tag is late needed to upload the new release file to github and allow users to download the new release from github.
Go to the Release-changes wiki page and create the section/page for the new release. Copy the gathered changes from the Features-and-fixes-not-released-yet page to the section for the new release. Generate and add new cards list by perl script from .\Utils\find_new_cards.pl
. After that reset the Features-and-fixes-not-released-yet page to a initial state.
Go to the previously newly created tag for the release and edit the tag. Add a release title (in the form "xmage_1.4.32V0" and add a link to newly created release wiki page or section in the description field. Upload the release zip file (that needs a little while) and publish the release if the upload is finished.
This part describes what to to on the distibution to a XMage server side, to create a new release. The steps are based on the current xmage.de server installation and can vary, if you want to distribute the new version to another server.
For this you only need the server folder of the release. So first unpack the release zip file and rename the server folder from "mage-server" to "mage-server1neu". Upload this folder to the folder your XMage server software is installed to on the server (maybe you update the needed files from step 3 already before you copy the mage-server1neu folder to the server). For the xmage.de server this is the /usr/games folder. In this folder the currently active version is always named "mage-server1". So you add with this step a new folder called "mage-server1neu". With the next scheduled restart of the xmage server or if you execute the "xmage start" or "xmage restart" script, the script checks if there is a "mage-server1neu" folder. If so, the old active folder is renamed to "mage-server1[current date/time]" and "mage-server1neu" is renamed to "mage-server1". The needed DB files with user and user records data are copied from the old active to the new active version. Than the XMage server is started.
ONLY NEEDED FOR MAJOR RELEASE
The \etc\init.d\ folder contains 4 script files that are used to start and stop the xmage server.
- mage-server
- mage-server1
- mage-server2
- mage-server-common
However one of the scripts needs to be updated, if the major version number is updated. That the "mage-server-common" script. In the following line of the script, you need to update the version number of the jar file to the needed major version number.
/usr/bin/cpulimit -l $limit -- \
/usr/bin/java $options \
-Djava.security.policy=./config/security.policy \
-Djava.util.logging.config.file=./config/logging.config \
-Dlog4j.configuration=file:./config/log4j.properties \
-jar ${base}/lib/mage-server-1.4.31.jar \
-adminPassword=[****] >/dev/null 2>/dev/null &
;;
The server installation on xmage needs three files, that are different from the default relase, and you need to update or replace the files on the server directory you copied to the server. You can update/change this files before or after copying the mage-server1neu folder to the server.
server.msg.txt
It includes the server specific messages, that are shown on the button of the xmage client and is located in the main mage-server1 directory.
config.xml
It includes the server specific IP and configuration. For a major release all the version numbers of the references jar files need to be updated. Also if new formats or game modes were added they have to be added to the specific file. Here for example you also decide, if the players can play agains the AI or not by allowing this play mode or not. It's located in the config sub directory.
log4j.properties
It defines what and how java logs problems. It's also located in the config sub directory.
To inform the client that there is a new release and define the name and the download URLs there is a config.json file on the xmage.de server. In the client the URL to that file is configured in the settings and is normally pointing to the /var/www/html/xmage/config.json file on the xmage.de server. You need to update the content of this file to point to the URLs of the new release and change the "version" tag to be unique and correct for the new release. Also normally there is a directory added for each release (name like the release number) to be able to update to a specific release by changing the URL in the client settings to the sub directory URL of the specific release.
It looks like this:
{
"java" : {
"version": "1.8.0_191",
"location": "http://download.oracle.com/otn-pub/java/jdk/8u191-b12/2787e4a523244c269598db4e85c51e0c/jre-8u191-"
},
"XMage" : {
"version": "1.4.32V0 (2018-11-26)",
"location": "https://github.com/magefree/mage/releases/download/xmage_1.4.32V0/xmage_1.4.32V0.zip",
"locations": ["http://xmage.de/files/xmage_1.4.32V0.zip"],
"torrent": "",
"images": "",
"Launcher" : {
"version": "0.3.8",
"location": "http://bit.ly/xmageLauncher038"
}
}
}
The complete release zip file should also be uploaded to /var/www/html/files to be availabel for users that can't use the github download.
It can be done manually by "xmage stop" followed by "xmage start" or by using only "xmage restart". Or sometimes it's also ok, to wait for the scheduled restart of the server. All the running games at that time are canceled. Now the new release is available and can be used.
The release thread and bug thread have to be updated.