Skip to content

Commit

Permalink
Merge branch 'main' into maintenance
Browse files Browse the repository at this point in the history
  • Loading branch information
ThirdEyeSqueegee committed Sep 7, 2023
2 parents ee1544f + 2d8b65b commit 2bf95cb
Show file tree
Hide file tree
Showing 8 changed files with 151 additions and 15 deletions.
File renamed without changes.
30 changes: 30 additions & 0 deletions .github/update-registry.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#Requires -Version 5

# args
param (
[string]$PathIn
)

# test-path
if (!(Test-Path "$PathIn/CommonLibSF") -or !(Test-Path "$PathIn/CommonLibSF/vcpkg.json") -or !(Test-Path "$PathIn/README.md")) {
Write-Output "::set-output name=VCPKG_SUCCESS::false"
exit
}

# commit time
$version = (Get-Date -AsUTC -Format "yyyy-MM-dd")

# update vcpkg
$vcpkg = [IO.File]::ReadAllText("$PathIn/CommonLibSF/vcpkg.json") | ConvertFrom-Json
$vcpkg.'version-date' = $version
$vcpkg = $vcpkg | ConvertTo-Json -Depth 9 | ForEach-Object { $_ -replace "(?m) (?<=^(?: )*)", " " }
[IO.File]::WriteAllText("$PathIn/CommonLibSF/vcpkg.json", $vcpkg)

# update readme
$readme = [IO.File]::ReadAllLines("$PathIn/README.md")
$readme = $readme -replace "(?<=label=vcpkg&message=).+?(?=&color)", $version
[IO.File]::WriteAllLines("$PathIn/README.md", $readme)

# status
Write-Output "::set-output name=VCPKG_SUCCESS::true"
Write-Output "::set-output name=VCPKG_VERSION::$version"
21 changes: 21 additions & 0 deletions .github/workflows/lint_pr_title.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# https://github.com/amannn/action-semantic-pull-request
name: "Lint PR against Conventional Commits"

on:
pull_request_target:
types:
- opened
- edited
- synchronize

permissions:
pull-requests: read

jobs:
main:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49 changes: 49 additions & 0 deletions .github/workflows/main_ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Main CI

on:
push:
branches: [ main ]
paths:
- '.github/workflows/main_ci.yml'
- 'CommonLibSF/**'
pull_request:
branches: [ main, feature/* ]
workflow_dispatch:

env:
VCPKG_COMMIT_ID: 095ee8757ec933b22d445738d2dbb1ce89bb8021

jobs:
build-and-test-vcpkg:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
build-type:
- debug
- release
compiler:
- msvc
- clang-cl
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup MSVC Environment
uses: ilammy/[email protected]

- name: Setup vcpkg
uses: lukka/run-vcpkg@v11
with:
vcpkgGitCommitId: ${{ env.VCPKG_COMMIT_ID }}

- name: Setup cmake
uses: jwlawson/[email protected]
with:
cmake-version: '3.26'

- name: Generate
run: cmake -B "${{ github.workspace }}/build" -S "${{ github.workspace }}/CommonLibSF" --preset=build-debug-${{ matrix.compiler }}

- name: Build
run: cmake --build "${{ github.workspace }}/build" --config ${{ matrix.build-type }}
36 changes: 28 additions & 8 deletions .github/workflows/maintenance.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,46 @@
on: [push]
name: "Maintainance"

on:
workflow_run:
workflows: ["Main CI"]
types:
- completed

jobs:
maintainance:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}

steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v2

- shell: pwsh
run: "& ${{ github.workspace }}/CommonLibSF/cmake/make-directives.ps1 ${{ github.workspace }}/CommonLibSF"
- name: Update Starfield.h
shell: pwsh
run: "& ${{ github.workspace }}/.github/make-directives.ps1 ${{ github.workspace }}/CommonLibSF"

- uses: DoozyX/[email protected]
- name: Enforce style formatting
uses: DoozyX/[email protected]
with:
source: '.'
exclude: './docs'
extensions: 'c,cc,cpp,cxx,h,hpp,hxx,inl,inc,ixx'
extensions: 'c,cc,cpp,cppm,cxx,h,hpp,hxx,inl,inc,ixx,mxx'
clangFormatVersion: 16
inplace: True

- name: Update vcpkg version-date
id: versioning
shell: pwsh
run: "& ${{ github.workspace }}/.github/update-registry.ps1 ${{ github.workspace }}"

- name: Check for success
run: exit 1
if: ${{ steps.versioning.outputs.VCPKG_SUCCESS == 'false' }}

- uses: EndBug/add-and-commit@v9
- name: Check for commit
uses: EndBug/add-and-commit@v9
with:
author_name: maintenance
message: 'chore: maintenance'
message: 'ci: maintenance `${{ steps.versioning.outputs.VCPKG_VERSION }}`'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8 changes: 4 additions & 4 deletions CommonLibSF/CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"minor": 26,
"patch": 0
},
"configurePresets": [ // TODO: Add Ninja presets
"configurePresets": [
{
"name": "common",
"hidden": true,
Expand Down Expand Up @@ -114,7 +114,7 @@
"environment": {
"CC": "clang-cl",
"CXX": "clang-cl",
"PROJECT_COMPILER_FLAGS": "/permissive- /EHsc /W4 /WX -Wno-overloaded-virtual -Wno-delete-non-abstract-non-virtual-dtor -Wno-inconsistent-missing-override -Wno-reinterpret-base-class"
"PROJECT_COMPILER_FLAGS": "/permissive- /EHsc /W4 /WX -Wno-overloaded-virtual -Wno-delete-non-abstract-non-virtual-dtor -Wno-inconsistent-missing-override -Wno-reinterpret-base-class -D__cpp_consteval"
}
},
{
Expand Down Expand Up @@ -202,7 +202,7 @@
"inherits": [
"common",
"packaging-vcpkg",
"buildtype-minsizerel",
"buildtype-debug",
"generator-msvc",
"compiler-msvc"
]
Expand All @@ -213,7 +213,7 @@
"inherits": [
"common",
"packaging-vcpkg",
"buildtype-minsizerel",
"buildtype-debug",
"generator-msvc",
"compiler-clang-cl"
]
Expand Down
2 changes: 1 addition & 1 deletion CommonLibSF/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json",
"name": "commonlibsf",
"version-semver": "1.0.0",
"version-date": "2023-09-07",
"port-version": 0,
"description": "A collaborative reverse-engineered library for Starfield.",
"homepage": "https://github.com/Starfield-Reverse-Engineering/CommonLibSF",
Expand Down
20 changes: 18 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@

A collaborative reverse-engineered library for Starfield.

[![C++23](https://img.shields.io/static/v1?label=standard&message=c%2B%2B23&color=blue&logo=c%2B%2B&&logoColor=red&style=flat)](https://en.cppreference.com/w/cpp/compiler_support)
[![C++23](https://img.shields.io/static/v1?label=standard&message=c%2B%2B23&color=blue&logo=c%2B%2B&&logoColor=red&style=flat)](https://en.cppreference.com/w/cpp/compiler_support)
![Platform](https://img.shields.io/static/v1?label=platform&message=windows&color=dimgray&style=flat&logo=windows)
[![Game version](https://img.shields.io/badge/game%20version-1.7.23-orange)](#use)
[![Game version](https://img.shields.io/badge/game%20version-1.7.23-orange)](#Get-started)
[![VCPKG_VER](https://img.shields.io/static/v1?label=vcpkg&message=2023-09-07&color=green&style=flat)](https://github.com/Starfield-Reverse-Engineering/Starfield-RE-vcpkg)
[![Main CI](https://img.shields.io/github/actions/workflow/status/Starfield-Reverse-Engineering/CommonLibSF/main_ci.yml)](https://github.com/Starfield-Reverse-Engineering/CommonLibSF/actions/workflows/main_ci.yml)

## Build Dependencies

Expand All @@ -15,6 +18,7 @@ A collaborative reverse-engineered library for Starfield.
- Add the environment variable VCPKG_ROOT with the value as the path to the folder containing vcpkg
- [Visual Studio Community 2022](https://visualstudio.microsoft.com/)
- Desktop development with C++
* \*ClangCL toolset and build support if using clang-cl configuration

## Get started

Expand Down Expand Up @@ -52,6 +56,18 @@ CommonLib is incompatible with SFSE and is intended to replace it as a static de

## License

[GPL-3.0-or-later](COPYING) WITH [Modding Exception AND GPL-3.0 Linking Exception (with Corresponding Source)](EXCEPTIONS).
[GPL-3.0-or-later][LICENSE] WITH [Modding Exception AND GPL-3.0 Linking Exception (with Corresponding Source)](EXCEPTIONS).

Specifically, the **Modded Code** is Starfield (and its variants) and **Modding Libraries** include [SFSE](https://sfse.silverlock.org/) ([GitHub link](https://github.com/ianpatt/sfse)).

For additional information on GPL licenses, see the [FSF FAQ](https://www.gnu.org/licenses/gpl-faq.en.html)

## Credits

This is based on [CommonLibSSE][CommonlibSSE] started by [Ryan-rsm-McKenzie](https://github.com/Ryan-rsm-McKenzie) under a [MIT License][Commonlib_MIT]. Without him putting that together, much of the joint Bethesda RE scene would be drastically different. The MIT License is kept for historical purposes only and the [GPL](#license) controls. To the extent you want the [MIT licensed code][Commonlib_MIT], please reference [CommonlibSSE and forks][CommonlibSSE].

---

[Commonlib_MIT]: /CommonLibSF/LICENSES/COMMONLIB
[LICENSE]: COPYING
[CommonlibSSE]: https://github.com/Ryan-rsm-McKenzie/CommonLibSSE

0 comments on commit 2bf95cb

Please sign in to comment.