Skip to content

Commit

Permalink
Merge branch 'main' into soldier-and-infantry-rewrite
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreasBrostrom authored Aug 31, 2024
2 parents 51da695 + 187ba09 commit 05a0843
Show file tree
Hide file tree
Showing 28 changed files with 894 additions and 313 deletions.
16 changes: 11 additions & 5 deletions .github/workflows/arma.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,34 @@
name: Arma

name: Testing
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, ready_for_review]
push:
branches: main

jobs:
validate:
name: Validation
runs-on: ubuntu-latest
steps:
- name: Checkout the source code
uses: actions/checkout@master
- name: Validate SQF
if: always()
run: python3 tools/sqf_validator.py
- name: Validate Config
if: always()
run: python3 tools/config_style_checker.py
- name: Validate Stringtables
if: always()
run: python3 tools/stringtable_validator.py
- name: Check Strings
if: always()
run: python3 tools/check_strings.py
# - name: Check for BOM
# uses: arma-actions/bom-check@master

lint:
name: Linting
runs-on: ubuntu-latest
steps:
- name: Checkout the source code
Expand All @@ -33,6 +38,7 @@ jobs:
continue-on-error: true # No failure due to many false-positives

hemtt:
name: HEMTT Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down
51 changes: 35 additions & 16 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,39 @@
name: Build
name: Build and upload artifacts

on:
release:
types: [ published ]
push:
branches:
- main
pull_request_target:

jobs:
build:
runs-on: ubuntu-latest
name: Build
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Setup HEMTT
uses: arma-actions/hemtt@v1
- name: Run HEMTT build
run: ./tools/deploy.sh ${{ github.ref_name }}
- name: Upload release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref_name }}
file: release/7CavAddon_${{ github.ref_name }}-hemtt.zip
overwrite: true
- name: Checkout the source code
uses: actions/checkout@v4
- name: Setup HEMTT
uses: arma-actions/hemtt@v1
- name: Checkout pull request
uses: actions/checkout@v4
if: ${{ github.event_name == 'pull_request_target' }}
with:
path: pullrequest
ref: 'refs/pull/${{ github.event.number }}/merge'
- name: Replace addons with pull request addons
if: ${{ github.event_name == 'pull_request_target' }}
run: |
rm -r addons\
rm -r include\
xcopy /e /h /q pullrequest\addons addons\
xcopy /e /h /q pullrequest\include include\
- name: Run HEMTT build
run: hemtt build
- name: Rename build folder
run: mv .hemttout/build .hemttout/@cav
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: cav-${{ github.sha }}
path: .hemttout/@*
25 changes: 25 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Deploy Release
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: Run HEMTT release
run: |
.\tools\deploy-setVersion.ps1
hemtt release
Rename-Item release\cav-latest.zip 7CavAddon-${{github.ref_name}}.zip
- name: Upload release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
asset_name: 7CavAddon-${{github.ref_name}}.zip
file: release/7CavAddon-${{github.ref_name}}.zip
51 changes: 51 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Publish
run-name: Publishing ${{github.ref_name}} to ${{ inputs.environment }}

on:
workflow_dispatch:
inputs:
environment:
description: "Selected deploy environment"
required: true
default: "dev"
type: choice
options:
- dev
- live
jobs:
publish:
name: Publish to steam workshop
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: Obtaining release
if: ${{ inputs.environment == 'live' }}
run: |
.\tools\deploy-getRelease.ps1 ${{github.ref_name}}
Get-ChildItem -Path . -ErrorAction SilentlyContinue
- name: Deploy release build to workshop
if: ${{ inputs.environment == 'live' }}
run: |
Write-Host "Yey i did it!"
env:
ENVIRONMENT: ${{ inputs.environment }}

- name: Run HEMTT build
if: ${{ inputs.environment == 'dev' }}
run: |
hemtt build
env:
ENVIRONMENT: ${{ inputs.environment }}
- name: Deploy dev build to workshop
if: ${{ inputs.environment == 'dev' }}
run: |
steamcmd.exe +login $env:STEAM_USERNAME $env:STEAM_PASSWORD +workshop_build_item resources\dev-payload.vdf +quit
env:
ENVIRONMENT: ${{ inputs.environment }}

Binary file modified addons/insignia/data/Bravo_2.paa
Binary file not shown.
2 changes: 1 addition & 1 deletion addons/pronelauncher/functions/fnc_onKeyDown.sqf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "script_component.hpp"
#include "..\script_component.hpp"
/*
* Author: PiZZADOX, Jonpas
* Handles keyDown EH for overriding engine stance changes when in AT launcher stance.
Expand Down
1 change: 0 additions & 1 deletion addons/pronelauncher/functions/script_component.hpp

This file was deleted.

4 changes: 4 additions & 0 deletions resources/dev-description.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[h1]7th Cavalry Gaming Community Addon Development Build[/h1]
This is the development and experimental build of the 7th Cavalry Gaming Community Addon or 7CavAddon for short. This build contain experimental features and or items and is not recomended to be used unless you know what your doing.

To get the regular build go [url=https://steamcommunity.com/sharedfiles/filedetails/?id=3298466460]here[/url].
10 changes: 10 additions & 0 deletions resources/dev-payload.vdf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
"workshopitem"
{
"appid" "107410"
"publishedfileid" "3298481411"
"contentfolder" "D:\\a\\7CavAddon\\7CavAddon\\.hemttout\\build"
"previewfile" "D:\\a\\7CavAddon\\7CavAddon\\resources\\steam_preview-dev.jpg"
"title" "7CavAddon DevBuild [7CAV]"
"description" ""
"changenote" ""
}
53 changes: 31 additions & 22 deletions tools/check_strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ def getDefinedStrings(filepath):
# print("getDefinedStrings {0}".format(filepath))
with open(filepath, 'r', encoding="latin-1") as file:
content = file.read()
srch = re.compile('Key ID\=\"(STR_CAV_[_a-zA-Z0-9]*)"', re.IGNORECASE)
srch = re.compile('Key ID\=\"(STR_ACE_[_a-zA-Z0-9]*)"', re.IGNORECASE)
modStrings = srch.findall(content)
modStrings = [s.lower() for s in modStrings]
return modStrings

def getStringUsage(filepath):
selfmodule = (re.search('addons[\W]*([_a-zA-Z0-9]*)', filepath)).group(1)
# print("Checking {0} from {1}".format(filepath,selfmodule))
selfmodule = (re.search('(addons|optionals)[\W]*([_a-zA-Z0-9]*)', filepath)).group(2)
submodule = (re.search(f'(addons|optionals)[\W]*{selfmodule}[\W]*([_a-zA-Z0-9]*)', filepath)).group(2)
# print(f"Checking {filepath} from {selfmodule} ({submodule})")
fileStrings = []

with open(filepath, 'r') as file:
Expand All @@ -27,7 +28,7 @@ def getStringUsage(filepath):
srch = re.compile('(STR_CAV_[_a-zA-Z0-9]*)', re.IGNORECASE)
fileStrings = srch.findall(content)

srch = re.compile('[^E][CL]STRING\(([_a-zA-Z0-9]*)\)', re.IGNORECASE)
srch = re.compile('[^EB][CL]STRING\(([_a-zA-Z0-9]*)\)', re.IGNORECASE)
modStrings = srch.findall(content)
for localString in modStrings:
fileStrings.append("STR_CAV_{0}_{1}".format(selfmodule, localString))
Expand All @@ -37,6 +38,11 @@ def getStringUsage(filepath):
for (exModule, exString) in exStrings:
fileStrings.append("STR_CAV_{0}_{1}".format(exModule, exString))

srch = re.compile('SUB[CL]STRING\(([_a-zA-Z0-9]*)\)')
subStrings = srch.findall(content)
for (subString) in subStrings:
fileStrings.append(f"STR_CAV_{submodule}_{subString}")

srch = re.compile('IGNORE_STRING_WARNING\([\'"]*([_a-zA-Z0-9]*)[\'"]*\)')
ignoreWarnings = srch.findall(content)

Expand All @@ -51,23 +57,24 @@ def main(argv):
allDefinedStrings = []
allUsedStrings = []

# Allow running from root directory as well as from inside the tools directory
rootDir = "../addons"
if (os.path.exists("addons")):
rootDir = "addons"

for root, dirnames, filenames in os.walk(rootDir):
for filename in fnmatch.filter(filenames, '*.sqf'):
sqf_list.append(os.path.join(root, filename))
for filename in fnmatch.filter(filenames, '*.cpp'):
sqf_list.append(os.path.join(root, filename))
for filename in fnmatch.filter(filenames, '*.hpp'):
sqf_list.append(os.path.join(root, filename))
for filename in fnmatch.filter(filenames, '*.h'):
sqf_list.append(os.path.join(root, filename))

for filename in fnmatch.filter(filenames, '*.xml'):
xml_list.append(os.path.join(root, filename))
for folder in ['addons', 'optionals']:
# Allow running from root directory as well as from inside the tools directory
rootDir = "../" + folder
if (os.path.exists(folder)):
rootDir = folder

for root, dirnames, filenames in os.walk(rootDir):
for filename in fnmatch.filter(filenames, '*.sqf'):
sqf_list.append(os.path.join(root, filename))
for filename in fnmatch.filter(filenames, '*.cpp'):
sqf_list.append(os.path.join(root, filename))
for filename in fnmatch.filter(filenames, '*.hpp'):
sqf_list.append(os.path.join(root, filename))
for filename in fnmatch.filter(filenames, '*.h'):
sqf_list.append(os.path.join(root, filename))

for filename in fnmatch.filter(filenames, '*.xml'):
xml_list.append(os.path.join(root, filename))

for filename in xml_list:
allDefinedStrings = allDefinedStrings + getDefinedStrings(filename)
Expand All @@ -77,6 +84,8 @@ def main(argv):
allDefinedStrings = list(sorted(set(allDefinedStrings)))
allUsedStrings = list(sorted(set(allUsedStrings)))

if ("str_cav_tagging_name" in allUsedStrings): allUsedStrings.remove("str_cav_tagging_name") # Handle tagging macro

print("-----------")
countUnusedStrings = 0
countUndefinedStrings = 0
Expand All @@ -98,4 +107,4 @@ def main(argv):
return countUndefinedStrings

if __name__ == "__main__":
main(sys.argv)
main(sys.argv)
Loading

0 comments on commit 05a0843

Please sign in to comment.