Skip to content

Commit

Permalink
Merge pull request #31 from jonpas/hemtt-ci-and-cleanup
Browse files Browse the repository at this point in the history
Adapt to HEMTT v1, Rework CI and cleanup
  • Loading branch information
YannikH authored Nov 3, 2023
2 parents dbf3c16 + 50c22a3 commit 32f6186
Show file tree
Hide file tree
Showing 94 changed files with 368 additions and 3,764 deletions.
11 changes: 9 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
root = true

[*]
indent_size = 2
end_of_line = lf
insert_final_newline = true
charset = utf-8
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
* text=auto
*.png binary
*.jpg binary
*.paa binary
File renamed without changes.
10 changes: 0 additions & 10 deletions .github/workflows/Workflows_Documentation.md

This file was deleted.

49 changes: 32 additions & 17 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI/Validate
name: Build

on:
push:
Expand All @@ -11,29 +11,44 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout the source code
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Validate SQF
run: python3 tools/sqf_validator.py
- name: Validate Config
run: python3 tools/config_style_checker.py
- name: Validate Stringtables
run: python3 tools/stringtable_validator.py
- name: Validate Return Types
run: python3 tools/return_checker.py
- name: Check for BOM
uses: arma-actions/bom-check@master

build:
runs-on: ubuntu-latest
steps:
- name: Checkout the source code
uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Build with HEMTT
uses: arma-actions/hemtt@master
with:
command: build --release --ci
- uses: actions/upload-artifact@v2
- name: Checkout the source code
uses: actions/checkout@v3
- name: Setup HEMTT
uses: arma-actions/hemtt@v1
- name: Run HEMTT release
run: hemtt release --no-archive
- name: Rename release folder
run: mv .hemttout/release .hemttout/@hatchet_framework
- uses: actions/upload-artifact@v3
with:
name: hatchet_framework-${{ github.sha }}-nobin
path: .hemttout/@*

publish:
needs: [build]
if: github.repository == 'Project-Hatchet/Interaction-Framework' && ! contains(github.event.head_commit.message, '[ci skip]') && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
# Upload to Steam Workshop
- name: Download Artifacts
uses: actions/download-artifact@v3
- uses: arma-actions/workshop-upload@v1
with:
name: hatchet
path: releases/hatchet.zip
appId: '107410'
itemId: '2403978406' # Hatchet Framework - Test Version
contentPath: '.hemttout/@*'
changelog: 'See changelog on GitHub: https://github.com/Project-Hatchet/Interaction-Framework/commits'
env:
STEAM_USERNAME: ${{ secrets.STEAM_USERNAME }}
STEAM_PASSWORD: ${{ secrets.STEAM_PASSWORD }}
30 changes: 0 additions & 30 deletions .github/workflows/development.yml

This file was deleted.

14 changes: 6 additions & 8 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@ on:
- main

jobs:
update_release_draft:
draft:
runs-on: ubuntu-latest
if: github.repository == 'Project-Hatchet/Interaction-Framework'
steps:
# Drafts your next Release notes as Pull Requests are merged into "master"
- uses: release-drafter/release-drafter@v5
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
with:
config-name: my-config.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Release Drafter
uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36 changes: 36 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Release

on:
push:
tags:
- 'v*.*.*'

jobs:
build_addon:
runs-on: ubuntu-latest
steps:
- name: Checkout the source code
uses: actions/checkout@v3
- name: Setup HEMTT
uses: arma-actions/hemtt@v1
- name: Run HEMTT release
run: hemtt release
- name: Rename release folder
run: mv .hemttout/release .hemttout/@hatchet_framework
- name: Upload to GitHub
uses: actions/action-gh-release@v1
with:
draft: true
files: releases/hatchet_framework_*.zip
name: 'Hatchet Framework ${{ github.ref_name }}'
tag_name: ${{ github.ref_name }}
target_commitish: ${{ github.sha }}
#- uses: arma-actions/workshop-upload@v1
# with:
# appId: '107410'
# itemId: '' # Hatchet Framework - Stable Version
# contentPath: '.hemttout/@*'
# changelog: 'See changelog on GitHub: https://github.com/Project-Hatchet/Interaction-Framework/releases'
# env:
# STEAM_USERNAME: ${{ secrets.STEAM_USERNAME }}
# STEAM_PASSWORD: ${{ secrets.STEAM_PASSWORD }}
28 changes: 0 additions & 28 deletions .github/workflows/release_main.yml

This file was deleted.

28 changes: 0 additions & 28 deletions .github/workflows/release_rc.yml

This file was deleted.

24 changes: 19 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
*.zip
*.bak
*.cache
keys/*
*.pbo
texHeaders.bin
*.swp
*.swo
*.biprivatekey
Thumbs.db

## Added by HEMTT
## HEMTT
releases/*
*.biprivatekey
keys/*
.hemtt/local.toml
addons/*.pbo
hemtt
hemtt.exe
.hemttout
####

## SCONS
release
.sconsign.dblite
####
9 changes: 0 additions & 9 deletions .hemtt/base.toml

This file was deleted.

11 changes: 11 additions & 0 deletions .hemtt/hooks/post_release/01_rename_zip.rhai
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
let releases = HEMTT_RFS.join("releases");
let name_nospaces = HEMTT.project().name();
name_nospaces.replace(" ", "_");

let src = releases.join(HEMTT.project().prefix() + "-" + HEMTT.project().version().to_string() + ".zip");
let dst = releases.join(name_nospaces.to_lower() + "_" + HEMTT.project().version().to_string_short() + ".zip");

print("Moving zip to " + dst);
if !src.move(dst) {
warn("Failed to move " + src + " to " + dst + " (maybe --no-archive?)");
}
35 changes: 35 additions & 0 deletions .hemtt/project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name = "Hatchet Framework"
prefix = "hatchet_vxf"
author = "Project Hatchet"
mainprefix = "z"

[files]
include = [
"mod.cpp",
"README.md",
"LICENSE",
"logo_vxf_ca.paa",
"meta.cpp",
]

[version]
git_hash = 0

[asc]
enabled = true
exclude = [
"/initsettings.sqf",
"/initkeybinds.sqf",
"/xeh_prep.sqf",
]

[hemtt.config]
preset = "Hemtt"

[hemtt.release]
folder = "vxf_framework"

[hemtt.launch]
workshop = [
"450814997", # CBA_A3's Workshop ID
]
Binary file removed .sconsign.dblite
Binary file not shown.
6 changes: 0 additions & 6 deletions .travis.yml

This file was deleted.

6 changes: 0 additions & 6 deletions AUTHORS.txt

This file was deleted.

12 changes: 6 additions & 6 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def allFilesIn(path):
return [s.replace("$", "$$") for s in glob.glob(path + '/**/*', recursive=True) if os.path.isfile(s)]

def getSettings():
with open("build.json") as file:
with open("tools/build.json") as file:
return json.load(file)

def targetDefinition(target, description):
Expand Down Expand Up @@ -82,8 +82,8 @@ def commandsToCreateSymlink(pbo):
return commands

def buildPbo(settings,env, pbo):
env.Command(pbo.outputPath, allFilesIn(pbo.folder),
f'"{addonBuilderPath()}" "{os.path.abspath(pbo.folder)}" "{os.path.abspath(settings["addonsFolder"])}" -clear -include=buildExtIncludes.txt')
env.Command(pbo.outputPath, allFilesIn(pbo.folder),
f'"{addonBuilderPath()}" "{os.path.abspath(pbo.folder)}" "{os.path.abspath(settings["addonsFolder"])}" -clear -include=tools\\buildExtIncludes.txt')
targetDefinition(pbo.name, f"Build the {pbo.name} pbo.")
return env.Alias(pbo.name, pbo.outputPath)

Expand All @@ -100,14 +100,14 @@ pbos = getPboInfo(settings)
pboAliases = [buildPbo(settings,env, pbo) for pbo in pbos]

env.Command("buildTools", [], Mkdir("buildTools"))

env.Command(r"buildTools\Natural Docs", [], [downloadNaturaldocs, Delete(r"buildTools\NaturalDocs.zip")])

allPbos = env.Alias("all", pboAliases)
targetDefinition("all", "Build all pbos.")

buildDocs = env.Command(r"docs\index.html",
[s for s in allFilesIn(settings["addonsFolder"]) if s.endswith(".sqf")] + [r"buildTools\Natural Docs"],
[s for s in allFilesIn(settings["addonsFolder"]) if s.endswith(".sqf")] + [r"buildTools\Natural Docs"],
[Mkdir("docs"), r'"buildTools\Natural Docs\NaturalDocs.exe" naturaldocs'])
env.AlwaysBuild(buildDocs)

Expand All @@ -130,4 +130,4 @@ except Exception as e:
print(e)
print("Error: Couldn't find arma 3, cannot make or remove symlinks")

env.Default("all")
env.Default("all")
1 change: 0 additions & 1 deletion addons/hatchet_vxf_core/$PBOPREFIX$

This file was deleted.

Loading

0 comments on commit 32f6186

Please sign in to comment.