Skip to content

Commit

Permalink
Added CavAux assemble script and automated builder
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreasBrostrom committed Aug 9, 2024
0 parents commit a026e3b
Show file tree
Hide file tree
Showing 25 changed files with 2,744 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Deploy
on:
release:
types: [published]

jobs:
release:
runs-on: windows-latest
steps:
- name: Checkout the source code
uses: actions/checkout@v4
- name: Setup HEMTT
uses: arma-actions/hemtt@v1
- name: Setup steamcmd
uses: CyberAndrii/setup-steamcmd@v1
- name: Get short commit hash
run: |
git rev-parse --short=8 HEAD
echo "SHORT_SHA=$(git rev-parse --short=8 HEAD)" >> $GITHUB_ENV
- name: Assemble
env:
SHA_SHORT: ${{ secrets.STEAM_USERNAME }}
STEAM_USERNAME: ${{ secrets.STEAM_USERNAME }}
STEAM_PASSWORD: ${{ secrets.STEAM_PASSWORD }}
run: |
$env:Path += ";$PWD\scripts"
echo "Building ${{ github.ref_name }} $env:SHA_SHORT"
python scripts\assemble.py --username $env:STEAM_USERNAME --password $env:STEAM_PASSWORD -s $env:SHA_SHORT
- name: Upload release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
asset_name: cavaux-${{ github.ref_name }}.0.zip
file: release/cavaux-${{ github.ref_name }}.0.zip
26 changes: 26 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Testing

on:
push:
branches:
- main
pull_request:

jobs:
validate:
runs-on: ubuntu-latest
steps:
- name: Checkout the source code
uses: actions/checkout@master
- name: Checking json format
if: always()
run: bash scripts/checkJsonFormat.sh

hemtt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup HEMTT
uses: arma-actions/hemtt@v1
- name: HEMTT check
run: hemtt check
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
*.pbo
.hemttout
*.biprivatekey
[R|r]elease
[R|r]eleases
.vscode
config.json
testConfig.json
.cavauxout
.cavauxout.7z
34 changes: 34 additions & 0 deletions .hemtt/project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name = "7th Cavalry Auxiliary Mod"
author = "7th Cavalry S3 Mod Team"
prefix = "cavaux"
mainprefix = "z"

[files]
include = [
"mod.cpp",
"README*.md", # Translated READMEs get moved to root in a hook (virtual file system)
"LICENSE",
"logo_cavaux_ca.paa",
"meta.cpp",
]
exclude = [
"*.psd", # By default this list is empty
]

[version]
major = 0
minor = 0
patch = 0
build = 0

[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",
"-filePatching"
]
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# 7th Cavalry Gaming Auxiliary Modpack
1 change: 1 addition & 0 deletions addons/main/$PBOPREFIX$
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
z\cavaux\addons\main
12 changes: 12 additions & 0 deletions addons/main/CfgSettings.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
class CfgSettings {
class CBA {
class Versioning {
class cavaux {
class dependencies {
//Mod will hard exit if this is missing
CBA[] = {"cba_main", REQUIRED_CBA_VERSION, "(true)"};
};
};
};
};
};
35 changes: 35 additions & 0 deletions addons/main/config.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#include "script_component.hpp"

class CfgPatches {
class ADDON {
name = COMPONENT_NAME;
units[] = {};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {
// CBA
"cba_ui",
"cba_xeh",
"cba_jr"
};
author = CSTRING(modteam);
authors[] = {"Brostrom.A (Evul)"};
url = CSTRING(URL);
VERSION_CONFIG;
};
};

class CfgMods {
class PREFIX {
dir = "@cavaux";
name = CSTRING(Name);
picture = "A3\Ui_f\data\Logos\arma3_expansion_alpha_ca";
hidePicture = "true";
hideName = "true";
actionName = CSTRING(Website);
action = CSTRING(Url);
description = CSTRING(Description);
};
};

#include "CfgSettings.hpp"
17 changes: 17 additions & 0 deletions addons/main/script_component.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#define COMPONENT main
#define COMPONENT_BEAUTIFIED Main
#include "\z\cavaux\addons\main\script_mod.hpp"

// #define DEBUG_MODE_FULL
// #define DISABLE_COMPILE_CACHE
// #define ENABLE_PERFORMANCE_COUNTERS

#ifdef DEBUG_ENABLED_MAIN
#define DEBUG_MODE_FULL
#endif

#ifdef DEBUG_SETTINGS_MAIN
#define DEBUG_SETTINGS DEBUG_SETTINGS_MAIN
#endif

#include "\z\cavaux\addons\main\script_macros.hpp"
15 changes: 15 additions & 0 deletions addons/main/script_macros.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#include "\x\cba\addons\main\script_macros_common.hpp"
#include "\x\cba\addons\xeh\script_xeh.hpp"

// Default versioning level
#define DEFAULT_VERSIONING_LEVEL 2

#ifdef DISABLE_COMPILE_CACHE
#undef PREP
#define PREP(fncName) DFUNC(fncName) = compile preprocessFileLineNumbers QPATHTOF(functions\DOUBLES(fnc,fncName).sqf)
#else
#undef PREP
#define PREP(fncName) [QPATHTOF(functions\DOUBLES(fnc,fncName).sqf), QFUNC(fncName)] call CBA_fnc_compileFunction
#endif

#define PREP_MODULE(folder) [] call compile preprocessFileLineNumbers QPATHTOF(folder\__PREP__.sqf)
20 changes: 20 additions & 0 deletions addons/main/script_mod.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// COMPONENT should be defined in the script_component.hpp and included BEFORE this hpp

#define MAINPREFIX z
#define PREFIX cav

#include "script_version.hpp"

#define VERSION MAJOR.MINOR
#define VERSION_STR MAJOR.MINOR.PATCHLVL.BUILD
#define VERSION_AR MAJOR,MINOR,PATCHLVL,BUILD

// MINIMAL required version for the Mod. Components can specify others..
#define REQUIRED_VERSION 2.02
#define REQUIRED_CBA_VERSION {3,16,0}

#ifdef COMPONENT_BEAUTIFIED
#define COMPONENT_NAME QUOTE(7th Cavalry Auxiliary Addon - COMPONENT_BEAUTIFIED)
#else
#define COMPONENT_NAME QUOTE(PREFIX - COMPONENT)
#endif
4 changes: 4 additions & 0 deletions addons/main/script_version.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#define MAJOR 0
#define MINOR 0
#define PATCHLVL 0
#define BUILD 0
20 changes: 20 additions & 0 deletions addons/main/stringtable.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<Project name="cavaux">
<Package name="Main">
<Key ID="STR_cavaux_Main_Name">
<English>7th Cavalry Auxiliary Modpack</English>
</Key>
<Key ID="STR_cavaux_Main_ModTeam">
<English>7th Cavalry S3 Mod Team</English>
</Key>

<Key ID="STR_cavaux_Main_Url">
<English>http://7cav.us</English>
</Key>
<Key ID="STR_cavaux_Main_Website">
<English>Website</English>
</Key>
<Key ID="STR_cavaux_Main_Description">
<English>Issue Tracker: https://github.com/7cav/cavaux/issues</English>
</Key>
</Package>
</Project>
Loading

0 comments on commit a026e3b

Please sign in to comment.