Added version tag

Update increase_version.js

Update increase_version.js

Update increase_version.js

Create increase_version.js

Updated workflows

Update .gitignore

Update build.bat

Change hash string

Update increase_version.js

Added commit hash

v1.0.3
This commit is contained in:
Pax1601 2023-12-14 10:25:00 +01:00
parent 243f58ecf3
commit 2d339d7161
27 changed files with 119 additions and 39 deletions

View File

@ -1,4 +1,4 @@
name: Backend build
name: Build & package
on:
push:
@ -33,6 +33,6 @@ jobs:
- name: Upload a Build Artifact
uses: actions/upload-artifact@v3.1.3
with:
name: Installer
name: latest
path: installer/Output/*.exe

3
.gitignore vendored
View File

@ -17,3 +17,6 @@ hgt
/src/html
/src/latex
client/public/stylesheets/leaflet/leaflet-gesture-handling.css
client/public/javascripts/leaflet.nauticscale.js
client/public/javascripts/L.Path.Drag.js

View File

@ -1,4 +1,4 @@
call git clean -fx
call node increase_version.js
cd src
msbuild olympus.sln /t:Build /p:Configuration=Release

View File

@ -112,7 +112,7 @@ function onListening() {
debug('Listening on ' + bind);
}
console.log("DCS Olympus server v1.0.2 started correctly!")
console.log("DCS Olympus server {{OLYMPUS_VERSION_NUMBER}}_{{OLYMPUS_COMMIT_HASH}} started correctly!")
console.log("Waiting for connections...")
process.title = `DCS Olympus server v1.0.2 (${port})`;
process.title = `DCS Olympus server {{OLYMPUS_VERSION_NUMBER}} (${port})`;

View File

@ -42,7 +42,7 @@ async function run() {
console.log('\x1b[36m%s\x1b[0m', "*********************************************************************");
console.log('\x1b[36m%s\x1b[0m', "");
console.log("DCS Olympus configurator v1.0.2");
console.log("DCS Olympus configurator {{OLYMPUS_VERSION_NUMBER}}_{{OLYMPUS_COMMIT_HASH}}");
console.log("");
var newValue;

View File

@ -2,7 +2,7 @@
"name": "DCSOlympus",
"node-main": "./bin/www",
"main": "http://localhost:3000",
"version": "v1.0.2",
"version": "{{OLYMPUS_VERSION_NUMBER}}",
"private": true,
"scripts": {
"build": "browserify .\\src\\index.ts --debug -o .\\public\\javascripts\\bundle.js -t [ babelify --global true --presets [ @babel/preset-env ] --extensions '.js'] -p [ tsify --noImplicitAny ] && copy.bat",

View File

@ -29,7 +29,7 @@ import { UnitListPanel } from "./panels/unitlistpanel";
import { ContextManager } from "./context/contextmanager";
import { Context } from "./context/context";
var VERSION = "v1.0.2";
var VERSION = "{{OLYMPUS_VERSION_NUMBER}}";
var DEBUG = false;
export class OlympusApp {

View File

@ -3,7 +3,7 @@
<div id="app-summary">
<h2>DCS Olympus</h2>
<h4>Dynamic Unit Command</h4>
<div class="app-version">Version <span class="app-version-number">v1.0.2</span></div>
<div class="app-version">Version <span class="app-version-number">{{OLYMPUS_VERSION_NUMBER}}</span></div>
<div class="app-version">Latest version <span id="latest-version" class="app-version-number"></span></div>
</div>

View File

@ -6,7 +6,7 @@
<div class="ol-select-options">
<div id="toolbar-summary">
<h3>DCS Olympus</h3>
<div class="accent-green app-version-number">version v1.0.2</div>
<div class="accent-green app-version-number">version {{OLYMPUS_VERSION_NUMBER}}_{{OLYMPUS_COMMIT_HASH}}</div>
</div>
<div>
<a href="https://discord.gg/wWXyVVBZT7" target="_blank">Discord</a>

77
increase_version.js Normal file
View File

@ -0,0 +1,77 @@
const path = require("path");
const fs = require("fs");
let files = [];
const revision = require('child_process').execSync('git rev-parse --short HEAD').toString().trim();
function throughDirectory(directory) {
fs.readdirSync(directory).forEach(file => {
const absolute = path.join(directory, file);
if (!file.includes("increase_version.js")) {
if (fs.statSync(absolute).isDirectory())
{
return throughDirectory(absolute);
}
else {
return files.push(absolute);
}
}
});
}
fs.readFile("./version.json", "utf8", (error, data) => {
if (error) {
console.log(error);
return;
}
const versionJSON = JSON.parse(data);
var version = versionJSON["version"];
console.log(`Setting version number to ${version}`);
version = version.replace("v", "");
var arr = version.split(".");
const major = arr[0];
const minor = arr[1];
const minorminor = arr[2];
throughDirectory(".");
files.forEach((file) => {
fs.readFile(file, 'utf8', function (err,data) {
if (err) {
return console.log(err);
}
if (data.search(/{{OLYMPUS_VERSION_NUMBER}}/g) >= 0) {
console.log(`Replacing version in ${file}`);
var result = data.replace(/{{OLYMPUS_VERSION_NUMBER}}/g, `v${major}.${minor}.${minorminor}`);
result = result.replace(/{{OLYMPUS_COMMIT_HASH}}/g, revision);
fs.writeFile(file, result, 'utf8', (err) => {
if (err) return console.log(err);
});
}
if (data.search(/1,0,2/g) >= 0) {
console.log(`Replacing version in ${file}`);
var result = data.replace(/1,0,2/g, `${major},${minor},${minorminor}`);
fs.writeFile(file, result, 'utf8', (err) => {
if (err) return console.log(err);
});
}
if (data.search(/{{OLYMPUS_VS_VERSION_NUMBER_2}}/g) >= 0) {
console.log(`Replacing version in ${file}`);
var result = data.replace(/{{OLYMPUS_VS_VERSION_NUMBER_2}}/g, `${major}.${minor}.${minorminor}`);
fs.writeFile(file, result, 'utf8', (err) => {
if (err) return console.log(err);
});
}
});
});
});

View File

@ -7,7 +7,7 @@
__/ | | |
|___/ |_|
v1.0.2
{{OLYMPUS_VERSION_NUMBER}}_{{OLYMPUS_COMMIT_HASH}}
INSTALLATION INSTRUCTIONS

View File

@ -7,7 +7,7 @@
__/ | | |
|___/ |_|
v1.0.2
{{OLYMPUS_VERSION_NUMBER}}_{{OLYMPUS_COMMIT_HASH}}
INSTALLATION INSTRUCTIONS

View File

@ -1,4 +1,4 @@
#define version "v1.0.2"
#define version "{{OLYMPUS_VERSION_NUMBER}}_{{OLYMPUS_COMMIT_HASH}}"
[Setup]
AppName=DCS Olympus

View File

@ -15,7 +15,7 @@ declare_plugin(self_ID,
shortName = "Olympus",
fileMenuName = "Olympus",
version = "v1.0.2",
version = "{{OLYMPUS_VERSION_NUMBER}}",
state = "installed",
developerName= "DCS Refugees 767 squadron",
info = _("DCS Olympus is a mod for DCS World. It allows users to spawn, control, task, group, and remove units from a DCS World server using a real-time map interface, similarly to Real Time Strategy games. The user interface also provides useful informations units, like loadouts, fuel, tasking, and so on. In the future, more features for DCS World GCI and JTAC will be available."),

View File

@ -1,4 +1,4 @@
local version = "v1.0.2"
local version = "{{OLYMPUS_VERSION_NUMBER}}_{{OLYMPUS_COMMIT_HASH}}"
local debug = false -- True enables debug printing using DCS messages

View File

@ -1,4 +1,4 @@
local version = 'v1.0.2'
local version = '{{OLYMPUS_VERSION_NUMBER}}_{{OLYMPUS_COMMIT_HASH}}'
local lfs = require("lfs")
Olympus = {}

View File

@ -182,7 +182,7 @@
<EnableUAC>false</EnableUAC>
<AdditionalDependencies>lua.lib; GeographicLib-i.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>..\..\third-party\lua</AdditionalLibraryDirectories>
<Version>v1.0.2</Version>
<Version>{{OLYMPUS_VERSION_NUMBER}}_{{OLYMPUS_COMMIT_HASH}}</Version>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">

View File

@ -61,8 +61,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,1,0
PRODUCTVERSION 1,0,1,0
FILEVERSION {{OLYMPUS_VS_VERSION_NUMBER_1}},0
PRODUCTVERSION {{OLYMPUS_VS_VERSION_NUMBER_1}},0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -79,12 +79,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "DCS Olympus"
VALUE "FileDescription", "DCS Olympus"
VALUE "FileVersion", "1.0.2.0"
VALUE "FileVersion", "{{OLYMPUS_VS_VERSION_NUMBER_2}}.0"
VALUE "InternalName", "dcstools.dll"
VALUE "LegalCopyright", "Copyright (C) 2023"
VALUE "OriginalFilename", "dcstools.dll"
VALUE "ProductName", "DCS Olympus"
VALUE "ProductVersion", "1.0.2.0"
VALUE "ProductVersion", "{{OLYMPUS_VS_VERSION_NUMBER_2}}.0"
END
END
BLOCK "VarFileInfo"

View File

@ -142,7 +142,7 @@
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
<Version>v1.0.2</Version>
<Version>{{OLYMPUS_VERSION_NUMBER}}_{{OLYMPUS_COMMIT_HASH}}</Version>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">

View File

@ -61,8 +61,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,1,0
PRODUCTVERSION 1,0,1,0
FILEVERSION {{OLYMPUS_VS_VERSION_NUMBER_1}},0
PRODUCTVERSION {{OLYMPUS_VS_VERSION_NUMBER_1}},0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -79,12 +79,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "DCS Olympus"
VALUE "FileDescription", "DCS Olympus"
VALUE "FileVersion", "1.0.2.0"
VALUE "FileVersion", "{{OLYMPUS_VS_VERSION_NUMBER_2}}.0"
VALUE "InternalName", "logger.dll"
VALUE "LegalCopyright", "Copyright (C) 2023"
VALUE "OriginalFilename", "logger.dll"
VALUE "ProductName", "DCS Olympus"
VALUE "ProductVersion", "1.0.2.0"
VALUE "ProductVersion", "{{OLYMPUS_VS_VERSION_NUMBER_2}}.0"
END
END
BLOCK "VarFileInfo"

View File

@ -141,7 +141,7 @@
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
<Version>v1.0.2</Version>
<Version>{{OLYMPUS_VERSION_NUMBER}}_{{OLYMPUS_COMMIT_HASH}}</Version>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">

View File

@ -61,8 +61,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,1,0
PRODUCTVERSION 1,0,1,0
FILEVERSION {{OLYMPUS_VS_VERSION_NUMBER_1}},0
PRODUCTVERSION {{OLYMPUS_VS_VERSION_NUMBER_1}},0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -79,12 +79,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "DCS Olympus"
VALUE "FileDescription", "DCS Olympus"
VALUE "FileVersion", "1.0.2.0"
VALUE "FileVersion", "{{OLYMPUS_VS_VERSION_NUMBER_2}}.0"
VALUE "InternalName", "luatools.dll"
VALUE "LegalCopyright", "Copyright (C) 2023"
VALUE "OriginalFilename", "luatools.dll"
VALUE "ProductName", "DCS Olympus"
VALUE "ProductVersion", "1.0.2.0"
VALUE "ProductVersion", "{{OLYMPUS_VS_VERSION_NUMBER_2}}.0"
END
END
BLOCK "VarFileInfo"

View File

@ -125,7 +125,7 @@
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
<Version>v1.0.2</Version>
<Version>{{OLYMPUS_VERSION_NUMBER}}_{{OLYMPUS_COMMIT_HASH}}</Version>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">

View File

@ -61,8 +61,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,1,0
PRODUCTVERSION 1,0,1,0
FILEVERSION {{OLYMPUS_VS_VERSION_NUMBER_1}},0
PRODUCTVERSION {{OLYMPUS_VS_VERSION_NUMBER_1}},0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -79,12 +79,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "DCS Olympus"
VALUE "FileDescription", "DCS Olympus"
VALUE "FileVersion", "1.0.2.0"
VALUE "FileVersion", "{{OLYMPUS_VS_VERSION_NUMBER_2}}.0"
VALUE "InternalName", "olympus.dll"
VALUE "LegalCopyright", "Copyright (C) 2023"
VALUE "OriginalFilename", "olympus.dll"
VALUE "ProductName", "DCS Olympus"
VALUE "ProductVersion", "1.0.2.0"
VALUE "ProductVersion", "{{OLYMPUS_VS_VERSION_NUMBER_2}}.0"
END
END
BLOCK "VarFileInfo"

View File

@ -95,7 +95,7 @@
<EnableUAC>false</EnableUAC>
<AdditionalDependencies>lua.lib</AdditionalDependencies>
<AdditionalLibraryDirectories>..\..\third-party\lua</AdditionalLibraryDirectories>
<Version>v1.0.2</Version>
<Version>{{OLYMPUS_VERSION_NUMBER}}_{{OLYMPUS_COMMIT_HASH}}</Version>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">

View File

@ -1,6 +1,6 @@
#pragma once
#define VERSION "v1.0.2"
#define VERSION "{{OLYMPUS_VERSION_NUMBER}}_{{OLYMPUS_COMMIT_HASH}}"
#define LOG_NAME "Olympus_log.txt"
#define REST_ADDRESS "http://localhost:30000"
#define REST_URI "olympus"

View File

@ -1,3 +1,3 @@
{
"version": "v1.0.2"
"version": "v1.0.3"
}