Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
3Mydlo3 authored Dec 13, 2024
0 parents commit dcd9127
Show file tree
Hide file tree
Showing 49 changed files with 1,307 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
root = true

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

[*.md]
trim_trailing_whitespace = false

[$PBOPREFIX$]
insert_final_newline = false
10 changes: 10 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
* text=auto
*.png binary
*.jpg binary
*.paa binary

# Change GitHub language categorisation
*.cpp linguist-language=SQF
*.hpp linguist-language=SQF
*.inc linguist-language=SQF
include/* linguist-vendored
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners
#
* @ArmaForces/sqf-devs
9 changes: 9 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
**When merged this pull request will:**
- Describe what this pull request will do
- Each change in a separate line

<!--
<details>
<summary>Images</summary>
</details>
-->
43 changes: 43 additions & 0 deletions .github/labels.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
[
{
"name": "bug",
"color": "#d73a4a",
"description": "Something isn't working"
},
{
"name": "bugfix",
"color": "#5e7f03",
"description": "Fix for a bug"
},
{
"name": "documentation",
"color": "#0075ca",
"description": "Improvements or additions to documentation"
},
{
"name": "duplicate",
"color": "#cfd3d7",
"description": "This issue or pull request already exists"
},
{
"name": "feature",
"color": "#21c2c4",
"description": "New feature or request"
},
{
"name": "enhancement",
"color": "#a2eeef",
"description": "Fixes and improvements for existing feature"
},
{
"name": "cleanup",
"color": "#00ffcc",
"description": "Code cleanup for existing feature"
},
{
"name": "ignore changelog",
"color": "#fff",
"description": "Do not add to changelog"
}
]

33 changes: 33 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
branches:
- master

name-template: 'v$NEXT_PATCH_VERSION'
tag-template: 'v$NEXT_PATCH_VERSION'

categories:
- title: '**ADDED:**'
labels:
- feature
- title: '**FIXED:**'
labels:
- bugfix
- title: '**CHANGED:**'
labels:
- cleanup
- enhancement

exclude-labels:
- 'ignore changelog'

change-template: '- $TITLE (#$NUMBER)'
template: |
_ArmaForces NEW_MOD_PRETTY release._
## Change Log Summary
$CHANGES
replacers:
# Category titles
- search: '/\#\# (\*\*(ADDED|FIXED|CHANGED):\*\*)/g'
replace: '$1'
53 changes: 53 additions & 0 deletions .github/workflows/arma.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Arma

on:
push:
branches:
- master
pull_request:

jobs:
validate:
runs-on: ubuntu-latest
steps:
- name: Checkout the source code
uses: actions/checkout@master
- name: Validate SQF
run: python3 tools/sqf_validator.py
- name: Validate Return Types
run: python3 tools/return_checker.py
- name: Validate Config
run: python3 tools/config_style_checker.py
- name: Validate Stringtables
run: python3 tools/stringtable_validator.py
- name: Check for BOM
uses: arma-actions/bom-check@master

lint:
runs-on: ubuntu-latest
steps:
- name: Checkout the source code
uses: actions/checkout@master
- name: Lint (sqflint)
uses: arma-actions/sqflint@master
continue-on-error: true # No failure due to many false-positives

build:
runs-on: windows-2022
steps:
- name: Checkout the source code
uses: actions/checkout@master
- name: Pull Arma3Tools
run: |
echo ${{ secrets.CR_PAT }} | docker login -u ${{ secrets.CR_USER }} --password-stdin ghcr.io
docker pull ghcr.io/armaforces/arma3tools:v2
- name: Build using HEMTT
run: |
docker run -v "$(pwd):c:/workdir" -e CI=$True ghcr.io/armaforces/arma3tools:v2 hemtt release
- uses: actions/upload-artifact@v2
with:
name: armaforces_NEW_MOD_SNAKE
path: |
releases/*.zip
!releases/NEW_MOD_ABBR-latest.zip
11 changes: 11 additions & 0 deletions .github/workflows/labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
on: issues
name: Create Default Labels
jobs:
labels:
name: Default Labels Action
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: lannonbr/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16 changes: 16 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Release Drafter

on:
push:
branches:
- master

jobs:
draft:
runs-on: ubuntu-latest
steps:
- name: Release Drafter
if: github.repository == 'ArmaForces/NEW_MOD_PRETTY'
uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
70 changes: 70 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Release

on:
release:
types:
- published

jobs:
build_addon:
runs-on: windows-2022
steps:
- name: Set VERSION env
run: echo VERSION=${GITHUB_REF:11} >> $GITHUB_ENV

- uses: actions/checkout@v2

- name: Pull Arma3Tools
run: |
echo ${{ secrets.CR_PAT }} | docker login -u ${{ secrets.CR_USER }} --password-stdin ghcr.io
docker pull ghcr.io/armaforces/arma3tools:v2
- name: Build using HEMTT
run: |
docker run -v "$(pwd):c:/workdir" -e CI=$True ghcr.io/armaforces/arma3tools:v2 hemtt release
- uses: actions/upload-artifact@v2
with:
name: hemttout
path: .hemttout/
if-no-files-found: error
retention-days: 1

- uses: actions/upload-artifact@v2
with:
name: releases
path: releases/
if-no-files-found: error
retention-days: 7

release_addon:
runs-on: ubuntu-latest
needs: build_addon
steps:
- name: Set VERSION env
run: echo VERSION=${GITHUB_REF:11} >> $GITHUB_ENV

# Upload to GitHub
- uses: actions/download-artifact@v2
with:
name: releases
path: releases
- uses: softprops/action-gh-release@v1
with:
files: 'releases/NEW_MOD_ABBR-${{ env.VERSION }}-*.zip'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# Upload to Steam Workshop
- uses: actions/download-artifact@v2
with:
name: hemttout
path: .hemttout
- uses: arma-actions/workshop-upload@v1
with:
itemId: '1934142795' # Id of item to update
contentPath: '.hemttout/release'
changelog: 'https://github.com/ArmaForces/NEW_MOD_PRETTY/releases/tag/v${{ env.VERSION }}'
env:
STEAM_USERNAME: ${{ secrets.STEAM_USERNAME }}
STEAM_PASSWORD: ${{ secrets.STEAM_PASSWORD }}
23 changes: 23 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Rust Checks

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: rustfmt
run: cd extension && cargo fmt -- --check
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: clippy
run: |
rustup -q component add clippy
cd extension && cargo clippy --all-features -- -D warnings
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Build output
/.hemttout/

# Releases
/releases/

hemtt
hemtt.exe
.hemtt/local
symbols/*

# Bikey
*.biprivatekey

extension/target/
14 changes: 14 additions & 0 deletions .hemtt/hooks/pre_build/set_version.rhai
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

let modCpp = HEMTT_VFS
.join("mod.cpp")
.open_file()
.read()
;

modCpp.replace("0.0.0", HEMTT.project().version().to_string_short());

HEMTT_VFS
.join("mod.cpp")
.create_file()
.write(modCpp)
;
Loading

0 comments on commit dcd9127

Please sign in to comment.