Skip to content

Commit

Permalink
Hemtt upgrade (#350)
Browse files Browse the repository at this point in the history
* changes for latest hemtt version

* update for new hemtt releases

* update workflow

* upper lower case linux is hard

* fix artifact upload

* do not grab the zip, but the loose files

* add release script

* rename release script and update run

* enable mod.cpp changes

* improve Hemtt upgrade

add improved ci annotations for hemtt warnings

* fix path issue in main workflow

* upgrade some deprecated packages

* upgrade artifcat uploader in the place i missed it

* fix notices not showing

fix some warnings

* improve logging in StringTable Duplicated Entry Checker

* Improve PrepChecker

* add some more notices to stringtable checker

* improve message of hemttchecker

* always use Latest Major for actions

---------

Co-authored-by: jokoho482 <hoffmann.jonas95@gmail.com>
Co-authored-by: Joko <hoffman.jonas95@gmail.com>
  • Loading branch information
3 people authored Feb 18, 2024
1 parent 28b8a7b commit c084c95
Show file tree
Hide file tree
Showing 29 changed files with 486 additions and 185 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,5 @@ end_of_line = lf
[addons/main/LICENSE]
end_of_line = lf

[.github/workflows/main.yml]
[.github/workflows/*.yml]
end_of_line = lf
4 changes: 3 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@
*.md text eol=crlf
*.toml text eol=crlf
*.txt text eol=crlf
*.xml text eol=crlf
*.xml text eol=crlf
*.rhai text eol=crlf
*.inc text eol=crlf
27 changes: 16 additions & 11 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ jobs:
- name: Check for BOM
uses: arma-actions/bom-check@master
- name: .editorconfig Checker
uses: jokoho48/action-editorconfig-checker@main
uses: editorconfig-checker/action-editorconfig-checker@v2
- name: Setup Node.js environment
uses: actions/setup-node@v2.1.2
uses: actions/setup-node@v4
- name: Run Stringtable Checker
run: cd tools/stringtableChecker && npm i &> /dev/null && cd ../../ && node tools/stringtableChecker/stringTableChecker.js
run: cd tools/nodejs_tools && npm i &> /dev/null && cd ../../ && node tools/nodejs_tools/stringTableChecker.js
- name: Check Functions
run: node tools/prepchecker.js
run: node tools/nodejs_tools/prepchecker.js

lint:
runs-on: ubuntu-latest
Expand All @@ -35,7 +35,7 @@ jobs:
- name: Lint (sqflint)
uses: jokoho48/sqflint@master
continue-on-error: true # No failure due to many false-positives
- uses: actions/upload-artifact@master
- uses: actions/upload-artifact@v4
with:
name: 'sqfLint Log'
path: 'sqf.log'
Expand All @@ -48,14 +48,19 @@ jobs:
- uses: actions/checkout@master
with:
fetch-depth: 1
- name: Build addon with HEMTT
uses: arma-actions/hemtt@master
with:
command: 'build --release'
- uses: actions/upload-artifact@master
- name: Setup Node.js environment
uses: actions/setup-node@v4
- name: Setup HEMTT
uses: arma-actions/hemtt@v1
- name: Run HEMTT build
run: hemtt release
- name: Check Hemtt Annotactions
run: cd tools/nodejs_tools && npm i &> /dev/null && cd ../../ && node tools/nodejs_tools/hemttchecker.js
- name: Upload Release
uses: actions/upload-artifact@v4
with:
name: '@LambsDanger'
path: 'releases/@LambsDanger*.zip'
path: '.hemttout/release/*'

stringtables:
runs-on: ubuntu-latest
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Release

on:
release:
types: [published]

permissions:
contents: write

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Setup HEMTT
uses: arma-actions/hemtt@main
- name: Run HEMTT build
run: hemtt release
- run: |
version="${{ github.event.release.tag_name }}"
mv releases/lambs-latest.zip "@LambsDanger_${version//[.]/_}.zip"
- name: Update Release with Files
id: create_version_release
uses: ncipollo/release-action@v1
with:
allowUpdates: true # Set this to false if you want to prevent updating existing releases
name: ${{ github.event.release.name }}
draft: ${{ github.event.release.unpublished }}
prerelease: ${{ github.event.release.prerelease }}
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: "./@LambsDanger_*.zip"
tag: ${{ github.event.release.tag_name }}
body: ${{ github.event.release.body }}
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ lint.bat

sqf/*

tools/stringtableChecker/node_modules
tools/nodejs_tools/node_modules

.vscode/

*.sqfc

.hemttout/
14 changes: 14 additions & 0 deletions .hemtt/hooks/pre_release/set_version.rhai
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Read the current contents of the mod.cpp
// file from the project source
let version = HEMTT_DIRECTORY
.join("mod.cpp")
.open_file()
.read();
// Replace the placeholder version with the actual version
version.replace("{version}", HEMTT.project().version().to_string_short());
// Write the new contents to the build output
// create_file will overwrite the file if it exists
HEMTT_OUTPUT
.join("mod.cpp")
.create_file()
.write(version);
37 changes: 37 additions & 0 deletions .hemtt/project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name = "LAMBS Danger"
prefix = "lambs"
author = "LAMBS Dev Team"
mainprefix = "z"

[version]
path = "addons/main/script_version.hpp"
git_hash = 0

[files]
include = [
"mod.cpp",
"*.paa",
"LICENSE",
"readme.txt",
"readme.md"
]

[hemtt.signing]
authority = "LambsDanger"

[hemtt.release]
folder = "lambs_danger"

[hemtt.launch.default]
workshop = [
"450814997", # CBA_A3's Workshop ID
]

parameters = [
"-skipIntro", # These parameters are passed to the Arma 3 executable
"-noSplash", # They do not need to be added to your list
"-showScriptErrors", # You can add additional parameters here
"-debug",
"-world=empty",
"-filePatching",
]
2 changes: 1 addition & 1 deletion addons/danger/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ADDON = false;
// mod check
GVAR(Loaded_WP) = isClass (configfile >> "CfgPatches" >> "lambs_wp");

#include "settings.sqf"
#include "settings.inc.sqf"

// FSM priorities ~ this could be made into CBA settings. But I kinda want to explore it a little first - nkenny
if (isNil QGVAR(fsmPriorities)) then {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion addons/eventhandlers/XEH_preInit.sqf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "script_component.hpp"
ADDON = false;

#include "settings.sqf"
#include "settings.inc.sqf"

#include "XEH_PREP.hpp"

Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions addons/formations/CfgFSMs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ class CfgFSMs {
function = "nothing";
parameters[] = {};
thresholds[] = {};
}
}
};
};
};
};
};
2 changes: 1 addition & 1 deletion addons/main/XEH_preInit.sqf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "script_component.hpp"
ADDON = false;
#include "XEH_PREP.hpp"
#include "settings.sqf"
#include "settings.inc.sqf"
GVAR(ChooseDialogSettingsCache) = false call CBA_fnc_createNamespace;

// check for WP module
Expand Down
2 changes: 1 addition & 1 deletion addons/main/functions/fnc_showDialog.sqf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "script_component.hpp"
#include "\a3\ui_f\hpp\definedikcodes.inc"
#include "\a3\ui_f\hpp\defineDIKCodes.inc"
/*
* Author: joko // Jonas
* Parses Data from UI Elements from Show Dialog
Expand Down
6 changes: 3 additions & 3 deletions addons/main/script_version.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#define MAJOR 0
#define MINOR 0
#define PATCHLVL 0
#define MAJOR 1
#define MINOR 6
#define PATCHLVL 1
#define BUILD 0
File renamed without changes.
2 changes: 1 addition & 1 deletion addons/wp/XEH_preInit.sqf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "script_component.hpp"
ADDON = false;
#include "settings.sqf"
#include "settings.inc.sqf"
#include "XEH_PREP.hpp"

if (isServer) then {
Expand Down
20 changes: 10 additions & 10 deletions addons/wp/ZEN_CfgContext.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,38 @@ class ZEN_context_menu_actions {
priority = 3;
class CreateTarget {
displayName = CSTRING(Context_CreateTarget);
statement = QUOTE([ARR_2(_objects, _position)] call FUNC(setTarget));
statement = QUOTE([ARR_2(_objects,_position)] call FUNC(setTarget));
icon = "\a3\3den\Data\CfgWaypoints\destroy_ca.paa";
};
class TaskArtilleryRegister {
displayName = CSTRING(Module_TaskArtilleryRegister_DisplayName);
statement = QUOTE([ARR_2(_groups, _objects)] call FUNC(setArtilleryRegister));
statement = QUOTE([ARR_2(_groups,_objects)] call FUNC(setArtilleryRegister));
icon = "\A3\ui_f\data\igui\cfg\simpleTasks\types\intel_ca.paa";
};
class TaskCamp {
displayName = CSTRING(Module_TaskCamp_DisplayName);
statement = QUOTE([ARR_2(_groups, _objects)] call FUNC(setCamp));
statement = QUOTE([ARR_2(_groups,_objects)] call FUNC(setCamp));
icon = "\a3\3DEN\Data\CfgWaypoints\Guard_ca.paa";
};
class TaskCQB {
displayName = CSTRING(Module_TaskCQB_DisplayName);
statement = QUOTE([ARR_2(_groups, _objects)] call FUNC(setCQB));
statement = QUOTE([ARR_2(_groups,_objects)] call FUNC(setCQB));
icon = "\a3\3DEN\Data\CfgWaypoints\Scripted_ca.paa";
};

class TaskGarrison {
displayName = CSTRING(Module_TaskGarrison_DisplayName);
statement = QUOTE([ARR_2(_groups, _objects)] call FUNC(setGarrison));
statement = QUOTE([ARR_2(_groups,_objects)] call FUNC(setGarrison));
icon = "\a3\3DEN\Data\CfgWaypoints\Guard_ca.paa";
};
class TaskPatrol {
displayName = CSTRING(Module_TaskPatrol_DisplayName);
statement = QUOTE([ARR_2(_groups, _objects)] call FUNC(setPatrol));
statement = QUOTE([ARR_2(_groups,_objects)] call FUNC(setPatrol));
icon = "\A3\3DEN\Data\CfgWaypoints\Loiter_ca.paa";
};
class TaskReset {
displayName = CSTRING(Module_TaskReset_DisplayName);
statement = QUOTE([ARR_2(_groups, _objects)] call FUNC(setReset));
statement = QUOTE([ARR_2(_groups,_objects)] call FUNC(setReset));
icon = "\a3\3DEN\Data\CfgWaypoints\cycle_ca.paa";
};
};
Expand All @@ -46,17 +46,17 @@ class ZEN_context_menu_actions {
condition = QUOTE((_groups isNotEqualTo []) || (_objects isNotEqualTo []));
class TaskCreep {
displayName = CSTRING(Module_TaskCreep_DisplayName);
statement = QUOTE([ARR_2(_groups, _objects)] call FUNC(setCreep));
statement = QUOTE([ARR_2(_groups,_objects)] call FUNC(setCreep));
icon = "\a3\3DEN\Data\CfgWaypoints\Sentry_ca.paa";
};
class TaskHunt {
displayName = CSTRING(Module_TaskHunt_DisplayName);
statement = QUOTE([ARR_2(_groups, _objects)] call FUNC(setHunt));
statement = QUOTE([ARR_2(_groups,_objects)] call FUNC(setHunt));
icon = "\a3\3DEN\Data\CfgWaypoints\Sentry_ca.paa";
};
class TaskRush {
displayName = CSTRING(Module_TaskRush_DisplayName);
statement = QUOTE([ARR_2(_groups, _objects)] call FUNC(setRush));
statement = QUOTE([ARR_2(_groups,_objects)] call FUNC(setRush));
icon = "\a3\3DEN\Data\CfgWaypoints\Sentry_ca.paa";
};
};
Expand Down
1 change: 0 additions & 1 deletion addons/wp/modules.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,6 @@ class GVAR(TaskRush) : GVAR(BaseModule) {
validate = "number";
condition = "0";
typeName = "NUMBER";
defaultValue = TASK_RUSH_CYCLETIME;
};
class ModuleDescription: ModuleDescription {};
};
Expand Down
File renamed without changes.
Loading

0 comments on commit c084c95

Please sign in to comment.