Skip to content

Commit d349ad6

Browse files
authored
Merge pull request #51 from apple1417/master
prep for 1.8 release
2 parents 3bcd85d + e84affb commit d349ad6

22 files changed

+250
-140
lines changed

.clang-tidy

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,6 @@ CheckOptions:
5151
readability-identifier-naming.NamespaceCase: lower_case
5252
readability-identifier-naming.ParameterCase: lower_case
5353
readability-identifier-naming.VariableCase: lower_case
54+
55+
readability-identifier-length.IgnoredVariableNames: _
5456
---

.cruft.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"template": "[email protected]:bl-sdk/common_dotfiles.git",
3-
"commit": "d03eee713ad436d20033d0598eb88f1529c56ca8",
3+
"commit": "cee5c9dbf5b95f57bb636e5138171aa6a4964cf1",
44
"checkout": null,
55
"context": {
66
"cookiecutter": {
@@ -15,7 +15,8 @@
1515
"__project_slug": "oak_mod_manager",
1616
"include_cpp": true,
1717
"include_py": true,
18-
"_template": "[email protected]:bl-sdk/common_dotfiles.git"
18+
"_template": "[email protected]:bl-sdk/common_dotfiles.git",
19+
"_commit": "cee5c9dbf5b95f57bb636e5138171aa6a4964cf1"
1920
}
2021
},
2122
"directory": null

.devcontainer/.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Ignore any custom folders outside of our predefined ones, to let you create your own
2+
# One use might be using your own container mapping the install path onto your actual game folder
3+
*/
4+
!clang-cross
5+
!llvm-mingw
6+
!mingw

.devcontainer/Dockerfile

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
FROM alpine:latest AS clang-cross
2+
CMD ["/bin/bash"]
3+
RUN <<EOF
4+
apk add --no-cache \
5+
bash \
6+
clang \
7+
clang-extra-tools \
8+
cmake \
9+
git \
10+
lld \
11+
llvm \
12+
msitools \
13+
ninja \
14+
openssh \
15+
perl \
16+
python3 \
17+
py3-requests
18+
git clone https://github.com/mstorsjo/msvc-wine.git
19+
msvc-wine/vsdownload.py \
20+
--accept-license \
21+
--dest /win-sdk \
22+
Microsoft.VisualStudio.Workload.VCTools \
23+
--arch x86 x64
24+
msvc-wine/install.sh /win-sdk
25+
rm -r msvc-wine
26+
EOF
27+
28+
# llvm-mingw comes with pre-built ubuntu binaries, so using that
29+
FROM ubuntu:latest AS llvm-mingw
30+
CMD ["/bin/bash"]
31+
RUN <<EOF
32+
apt-get update
33+
DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC \
34+
apt-get install -y \
35+
cmake \
36+
git \
37+
msitools \
38+
ninja-build \
39+
python-is-python3 \
40+
python3 \
41+
python3-requests \
42+
wget \
43+
xz-utils
44+
wget -nv https://github.com/mstorsjo/llvm-mingw/releases/download/20250114/llvm-mingw-20250114-msvcrt-ubuntu-20.04-x86_64.tar.xz
45+
tar -xf llvm-mingw-20250114-msvcrt-ubuntu-20.04-x86_64.tar.xz
46+
rm llvm-mingw-20250114-msvcrt-ubuntu-20.04-x86_64.tar.xz
47+
mv llvm-mingw-20250114-msvcrt-ubuntu-20.04-x86_64 /llvm-mingw
48+
EOF
49+
ENV PATH="/llvm-mingw/bin:$PATH"
50+
51+
FROM alpine:latest AS mingw
52+
CMD ["/bin/bash"]
53+
RUN <<EOF
54+
apk add --no-cache \
55+
bash \
56+
cmake \
57+
git \
58+
i686-mingw-w64-gcc \
59+
mingw-w64-gcc \
60+
msitools \
61+
ninja \
62+
openssh \
63+
py3-requests \
64+
python3
65+
EOF
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"name": "clang-cross",
3+
"build": {
4+
"dockerfile": "../Dockerfile",
5+
"target": "clang-cross"
6+
}
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"name": "llvm-mingw",
3+
"build": {
4+
"dockerfile": "../Dockerfile",
5+
"target": "llvm-mingw"
6+
}
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"name": "mingw",
3+
"build": {
4+
"dockerfile": "../Dockerfile",
5+
"target": "mingw"
6+
}
7+
}

.github/workflows/build.yml

Lines changed: 27 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,12 @@ jobs:
5555
submodules: recursive
5656

5757
- name: Configure build
58-
working-directory: ${{ env.GITHUB_WORKSPACE }}
5958
run: |
6059
pip install requests
6160
6261
cmake . --preset ${{ matrix.preset }} -G Ninja
6362
6463
- name: Build
65-
working-directory: ${{ env.GITHUB_WORKSPACE }}
6664
run: cmake --build out/build/${{ matrix.preset }} --target install
6765

6866
- name: Prepare Release Zip (dev ci)
@@ -84,87 +82,50 @@ jobs:
8482
path: "*.zip"
8583

8684
build-ubuntu:
87-
# Require at least 24 for the mingw build
88-
runs-on: ubuntu-24.04
85+
runs-on: ubuntu-latest
8986

9087
strategy:
9188
fail-fast: false
9289
matrix:
93-
preset:
94-
- clang-cross-release
95-
- llvm-mingw-release
96-
- mingw-release
90+
toolchain:
91+
- preset: clang-cross-release
92+
container: clang-cross
93+
- preset: llvm-mingw-release
94+
container: llvm-mingw
95+
- preset: mingw-release
96+
container: mingw
9797

9898
steps:
99-
- name: Setup CMake and Ninja
100-
uses: lukka/get-cmake@latest
101-
102-
- name: Setup apt packages
103-
uses: awalsh128/cache-apt-pkgs-action@latest
104-
with:
105-
packages: msitools python3-requests
106-
version: ${{ runner.os }}-apt
107-
108-
- name: Setup LLVM MinGW
109-
if: startswith(matrix.preset, 'llvm-mingw')
110-
run: |
111-
wget -nv ${{ env.LLVM_MINGW_DOWNLOAD }}
112-
tar -xf ${{ env.LLVM_MINGW_VERSION }}.tar.xz -C ~/
113-
echo $(readlink -f ~/${{ env.LLVM_MINGW_VERSION }}/bin) >> $GITHUB_PATH
114-
115-
- name: Setup MinGW
116-
if: startswith(matrix.preset, 'mingw')
117-
uses: egor-tensin/setup-mingw@v2
118-
with:
119-
platform: x64
120-
121-
- name: Setup Clang
122-
if: startswith(matrix.preset, 'clang-cross')
123-
uses: egor-tensin/setup-clang@v1
124-
125-
- name: Restore win sdk cache
126-
if: startswith(matrix.preset, 'clang-cross')
127-
uses: actions/cache@v4
128-
id: cache-win-sdk
129-
with:
130-
path: ~/win-sdk
131-
key: ${{ runner.os }}-win-sdk
132-
133-
- name: Setup win sdk
134-
if: startswith(matrix.preset, 'clang-cross') && steps.cache-win-sdk.outputs.cache-hit != 'true'
135-
run: |
136-
git clone https://github.com/mstorsjo/msvc-wine.git
137-
msvc-wine/vsdownload.py --accept-license --dest ~/win-sdk Microsoft.VisualStudio.Workload.VCTools
138-
msvc-wine/install.sh ~/win-sdk
139-
rm -r msvc-wine
140-
14199
- name: Checkout repository and submodules
142100
uses: actions/checkout@v4
143101
with:
144102
submodules: recursive
145103

146-
- name: Configure CMake
147-
working-directory: ${{ env.GITHUB_WORKSPACE }}
148-
# The extra msvc wine arg won't do anything if we're not cross compiling
149-
run: >
150-
cmake .
151-
--preset ${{ matrix.preset }}
152-
-G Ninja
153-
-DMSVC_WINE_ENV_SCRIPT=$(readlink -f ~)/win-sdk/bin/x64/msvcenv.sh
154-
155104
- name: Build
156-
working-directory: ${{ env.GITHUB_WORKSPACE }}
157-
run: cmake --build out/build/${{ matrix.preset }} --target install
158-
159-
- name: Prepare Release Zip (dev ci)
160-
if: inputs.new-release-tag == ''
161-
run: python prepare_release.py ${{ matrix.preset }} --skip-install --no-bl3 --no-wl --unified
105+
uses: devcontainers/[email protected]
106+
with:
107+
cacheFrom: ghcr.io/bl-sdk/${{ matrix.toolchain.container }}:latest
108+
configFile: .devcontainer/${{ matrix.toolchain.container }}/devcontainer.json
109+
push: never
110+
# The git watcher cmake thinks something's unsafe? Doesn't happen to me locally.
111+
# Only run the prepare release script if doing a dev ci build
112+
runCmd: |
113+
git config --global --add safe.directory `pwd`
114+
git config --global --add safe.directory `pwd`/libs/pluginloader
115+
git config --global --add safe.directory `pwd`/libs/pyunrealsdk
116+
git config --global --add safe.directory `pwd`/libs/pyunrealsdk/libs/unrealsdk
117+
118+
cmake . --preset ${{ matrix.toolchain.preset }} -G Ninja
119+
cmake --build out/build/${{ matrix.toolchain.preset }} --target install
120+
121+
[ ${{ inputs.new-release-tag == '' && 1 || 0 }} -ne 0 ] && \
122+
python prepare_release.py ${{ matrix.toolchain.preset }} --skip-install --no-bl3 --no-wl --unified
162123
163124
- name: Upload Artifact
164125
if: inputs.new-release-tag == ''
165126
uses: actions/upload-artifact@v4
166127
with:
167-
name: ${{ matrix.preset }}
128+
name: ${{ matrix.toolchain.preset }}
168129
path: "*.zip"
169130

170131
# ==============================================================================
@@ -201,7 +162,6 @@ jobs:
201162
submodules: recursive
202163

203164
- name: Configure CMake
204-
working-directory: ${{ env.GITHUB_WORKSPACE }}
205165
run: cmake . --preset ${{ matrix.preset }} -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On
206166

207167
- name: Remove `.modmap`s from compile commands
@@ -212,7 +172,6 @@ jobs:
212172
-Path "out\build\${{ matrix.preset }}\compile_commands.json"
213173
214174
- name: Run clang-tidy
215-
working-directory: ${{ env.GITHUB_WORKSPACE }}
216175
run: |
217176
python (Get-Command run-clang-tidy).Source `
218177
-p "out\build\${{ matrix.preset }}" `
@@ -229,7 +188,6 @@ jobs:
229188

230189
steps:
231190
- name: Setup Clang
232-
if: startswith(matrix.preset, 'clang')
233191
uses: egor-tensin/setup-clang@v1
234192

235193
- name: Checkout repository

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.vs
22
.vscode
3+
.idea
34

45
# C/C++ excludes
56
.cache/clangd

CMakePresets.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@
3030
"lhs": "${hostSystemName}",
3131
"rhs": "Windows"
3232
},
33+
"environment": {
34+
"MSVC_WINE_ENV_SCRIPT": "/win-sdk/bin/x64/msvcenv.sh"
35+
},
3336
"toolchainFile": "libs/pyunrealsdk/common_cmake/clang-cross-x64.cmake"
3437
},
3538
{

0 commit comments

Comments
 (0)