Skip to content

Commit 71bbf8c

Browse files
pchoteabcdefg30
authored andcommitted
Update scripts, packaging, and example mod for playtest-20201213.
1 parent 136e19d commit 71bbf8c

27 files changed

+582
-670
lines changed

.github/workflows/ci.yaml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Continuous Integration
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
linux-mono:
9+
name: Linux (mono)
10+
runs-on: ubuntu-20.04
11+
12+
steps:
13+
- name: Clone Repository
14+
uses: actions/checkout@v2
15+
16+
- name: Prepare Environment
17+
run: |
18+
. mod.config;
19+
awk '/\r$$/ { exit(1); }' mod.config || (printf "Invalid mod.config format. File must be saved using unix-style (LF, not CRLF or CR) line endings.\n"; exit 1);
20+
21+
- name: Check Code
22+
run: |
23+
make check
24+
make check-packaging-scripts
25+
26+
- name: Check Mod
27+
run: |
28+
sudo apt-get install lua5.1
29+
make check-scripts
30+
make test
31+
32+
windows:
33+
name: Windows (Framework 4.7)
34+
runs-on: windows-2019
35+
36+
steps:
37+
- name: Clone Repository
38+
uses: actions/checkout@v2
39+
40+
- name: Check Code
41+
shell: powershell
42+
run: |
43+
dotnet nuget locals all --clear
44+
.\make.ps1 check
45+
46+
- name: Check Mods
47+
run: |
48+
chocolatey install lua --version 5.1.5.52
49+
$ENV:Path = $ENV:Path + ";C:\Program Files (x86)\Lua\5.1\"
50+
.\make.ps1 check-scripts
51+
.\make.ps1 test

.github/workflows/packaging.yml

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
name: Release Packaging
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
linux:
10+
name: Linux AppImages
11+
runs-on: ubuntu-20.04
12+
13+
steps:
14+
- name: Clone Repository
15+
uses: actions/checkout@v2
16+
17+
- name: Prepare Environment
18+
run: echo "GIT_TAG=${GITHUB_REF#refs/tags/}" >> ${GITHUB_ENV}
19+
20+
- name: Package AppImage
21+
run: |
22+
make engine
23+
mkdir -p build/linux
24+
./packaging/linux/buildpackage.sh "${GIT_TAG}" "${PWD}/build/linux"
25+
26+
- name: Upload Packages
27+
uses: svenstaro/upload-release-action@v2
28+
with:
29+
repo_token: ${{ secrets.GITHUB_TOKEN }}
30+
tag: ${{ github.ref }}
31+
overwrite: true
32+
file_glob: true
33+
file: build/linux/*
34+
35+
macos:
36+
name: macOS Disk Images
37+
runs-on: macos-10.15
38+
39+
steps:
40+
- name: Clone Repository
41+
uses: actions/checkout@v2
42+
43+
- name: Prepare Environment
44+
run: echo "GIT_TAG=${GITHUB_REF#refs/tags/}" >> ${GITHUB_ENV}
45+
46+
- name: Package Disk Images
47+
env:
48+
MACOS_DEVELOPER_IDENTITY: ${{ secrets.MACOS_DEVELOPER_IDENTITY }}
49+
MACOS_DEVELOPER_CERTIFICATE_BASE64: ${{ secrets.MACOS_DEVELOPER_CERTIFICATE_BASE64 }}
50+
MACOS_DEVELOPER_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_DEVELOPER_CERTIFICATE_PASSWORD }}
51+
MACOS_DEVELOPER_USERNAME: ${{ secrets.MACOS_DEVELOPER_USERNAME }}
52+
MACOS_DEVELOPER_PASSWORD: ${{ secrets.MACOS_DEVELOPER_PASSWORD }}
53+
run: |
54+
make engine
55+
mkdir -p build/macos
56+
./packaging/macos/buildpackage.sh "${GIT_TAG}" "${PWD}/build/macos"
57+
58+
- name: Upload Packages
59+
uses: svenstaro/upload-release-action@v2
60+
with:
61+
repo_token: ${{ secrets.GITHUB_TOKEN }}
62+
tag: ${{ github.ref }}
63+
overwrite: true
64+
file_glob: true
65+
file: build/macos/*
66+
67+
windows:
68+
name: Windows Installers
69+
runs-on: ubuntu-20.04
70+
71+
steps:
72+
- name: Clone Repository
73+
uses: actions/checkout@v2
74+
75+
- name: Prepare Environment
76+
run: |
77+
echo "GIT_TAG=${GITHUB_REF#refs/tags/}" >> ${GITHUB_ENV}
78+
sudo apt-get update
79+
sudo apt-get install nsis
80+
81+
- name: Package Installers
82+
run: |
83+
make engine
84+
mkdir -p build/windows
85+
./packaging/windows/buildpackage.sh "${GIT_TAG}" "${PWD}/build/windows"
86+
87+
- name: Upload Packages
88+
uses: svenstaro/upload-release-action@v2
89+
with:
90+
repo_token: ${{ secrets.GITHUB_TOKEN }}
91+
tag: ${{ github.ref }}
92+
overwrite: true
93+
file_glob: true
94+
file: build/windows/*

.travis.yml

Lines changed: 0 additions & 51 deletions
This file was deleted.

Makefile

Lines changed: 27 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
# make check-sdk-scripts
2121
# make check-packaging-scripts
2222

23-
.PHONY: utility stylecheck build clean engine version check check-scripts check-sdk-scripts check-packaging-scripts check-variables
23+
.PHONY: check-sdk-scripts check-packaging-scripts check-variables engine all clean version check-scripts check test
2424
.DEFAULT_GOAL := all
2525

2626
PYTHON = $(shell command -v python3 2> /dev/null)
@@ -48,8 +48,19 @@ MOD_SOLUTION_FILES = $(shell find . -maxdepth 1 -iname '*.sln' 2> /dev/null)
4848

4949
MSBUILD = msbuild -verbosity:m -nologo
5050

51-
# Enable 32 bit builds while generating the windows installer
52-
WIN32 = false
51+
ifndef TARGETPLATFORM
52+
UNAME_S := $(shell uname -s)
53+
UNAME_M := $(shell uname -m)
54+
ifeq ($(UNAME_S),Darwin)
55+
TARGETPLATFORM = osx-x64
56+
else
57+
ifeq ($(UNAME_M),x86_64)
58+
TARGETPLATFORM = linux-x64
59+
else
60+
TARGETPLATFORM = unix-generic
61+
endif
62+
endif
63+
endif
5364

5465
check-sdk-scripts:
5566
@awk '/\r$$/ { exit(1); }' mod.config || (printf "Invalid mod.config format: file must be saved using unix-style (CR, not CRLF) line endings.\n"; exit 1)
@@ -110,43 +121,25 @@ check-variables:
110121
exit 1; \
111122
fi
112123

113-
engine-dependencies: check-variables check-sdk-scripts
114-
@./fetch-engine.sh || (printf "Unable to continue without engine files\n"; exit 1)
115-
@cd $(ENGINE_DIRECTORY) && make dependencies WIN32=$(WIN32)
116-
117124
engine: check-variables check-sdk-scripts
118125
@./fetch-engine.sh || (printf "Unable to continue without engine files\n"; exit 1)
119-
@cd $(ENGINE_DIRECTORY) && make core WIN32=$(WIN32)
120-
121-
utility: engine-dependencies engine
122-
@test -f "$(ENGINE_DIRECTORY)/OpenRA.Utility.exe" || (printf "OpenRA.Utility.exe not found!\n"; exit 1)
126+
@cd $(ENGINE_DIRECTORY) && make TARGETPLATFORM=$(TARGETPLATFORM) all
123127

124-
core:
125-
@command -v $(MSBUILD) >/dev/null || (echo "OpenRA requires the '$(MSBUILD)' tool provided by Mono >= 5.4."; exit 1)
128+
all: engine
129+
@command -v $(MSBUILD) >/dev/null || (echo "OpenRA requires the '$(MSBUILD)' tool provided by Mono >= 5.18."; exit 1)
126130
ifneq ("$(MOD_SOLUTION_FILES)","")
127-
@find . -maxdepth 1 -name '*.sln' -exec $(MSBUILD) -t:restore \;
128-
ifeq ($(WIN32), $(filter $(WIN32),true yes y on 1))
129-
@find . -maxdepth 1 -name '*.sln' -exec $(MSBUILD) -t:build -p:Configuration="Release-x86" \;
130-
else
131-
@$(MSBUILD) -t:build -p:Configuration=Release
132-
@find . -maxdepth 1 -name '*.sln' -exec $(MSBUILD) -t:build -p:Configuration=Release \;
131+
@find . -maxdepth 1 -name '*.sln' -exec $(MSBUILD) -t:Build -restore -p:Configuration=Release -p:TargetPlatform=$(TARGETPLATFORM) \;
133132
endif
134-
endif
135-
136-
all: engine-dependencies engine core
137133

138134
clean: engine
139-
@command -v $(MSBUILD) >/dev/null || (echo "OpenRA requires the '$(MSBUILD)' tool provided by Mono >= 5.4."; exit 1)
135+
@command -v $(MSBUILD) >/dev/null || (echo "OpenRA requires the '$(MSBUILD)' tool provided by Mono >= 5.18."; exit 1)
140136
ifneq ("$(MOD_SOLUTION_FILES)","")
141137
@find . -maxdepth 1 -name '*.sln' -exec $(MSBUILD) -t:clean \;
142138
endif
143139
@cd $(ENGINE_DIRECTORY) && make clean
144-
@printf "The engine has been cleaned.\n"
145140

146141
version: check-variables
147-
@awk '{sub("Version:.*$$","Version: $(VERSION)"); print $0}' $(MANIFEST_PATH) > $(MANIFEST_PATH).tmp && \
148-
awk '{sub("/[^/]*: User$$", "/$(VERSION): User"); print $0}' $(MANIFEST_PATH).tmp > $(MANIFEST_PATH) && \
149-
rm $(MANIFEST_PATH).tmp
142+
@sh -c '. $(ENGINE_DIRECTORY)/packaging/functions.sh; set_mod_version $(VERSION) $(MANIFEST_PATH)'
150143
@printf "Version changed to $(VERSION).\n"
151144

152145
check-scripts: check-variables
@@ -159,18 +152,18 @@ ifneq ("$(LUA_FILES)","")
159152
@luac -p $(LUA_FILES)
160153
endif
161154

162-
check: utility
155+
check: engine
163156
ifneq ("$(MOD_SOLUTION_FILES)","")
164157
@echo "Compiling in debug mode..."
165-
@$(MSBUILD) -t:build -p:Configuration=Debug
158+
@find . -maxdepth 1 -name '*.sln' -exec $(MSBUILD) -t:Build -restore -p:Configuration=Debug -p:TargetPlatform=$(TARGETPLATFORM) \;
166159
endif
167160
@echo "Checking runtime assemblies..."
168-
@MOD_SEARCH_PATHS="$(MOD_SEARCH_PATHS)" mono --debug "$(ENGINE_DIRECTORY)/OpenRA.Utility.exe" $(MOD_ID) --check-runtime-assemblies $(WHITELISTED_OPENRA_ASSEMBLIES) $(WHITELISTED_THIRDPARTY_ASSEMBLIES) $(WHITELISTED_CORE_ASSEMBLIES) $(WHITELISTED_MOD_ASSEMBLIES)
161+
@./utility.sh --check-runtime-assemblies $(WHITELISTED_OPENRA_ASSEMBLIES) $(WHITELISTED_THIRDPARTY_ASSEMBLIES) $(WHITELISTED_CORE_ASSEMBLIES) $(WHITELISTED_MOD_ASSEMBLIES)
169162
@echo "Checking for explicit interface violations..."
170-
@MOD_SEARCH_PATHS="$(MOD_SEARCH_PATHS)" mono --debug "$(ENGINE_DIRECTORY)/OpenRA.Utility.exe" $(MOD_ID) --check-explicit-interfaces
163+
@./utility.sh --check-explicit-interfaces
171164
@echo "Checking for incorrect conditional trait interface overrides..."
172-
@MOD_SEARCH_PATHS="$(MOD_SEARCH_PATHS)" mono --debug "$(ENGINE_DIRECTORY)/OpenRA.Utility.exe" $(MOD_ID) --check-conditional-trait-interface-overrides
165+
@./utility.sh --check-conditional-trait-interface-overrides
173166

174-
test: utility
167+
test: all
175168
@echo "Testing $(MOD_ID) mod MiniYAML..."
176-
@MOD_SEARCH_PATHS="$(MOD_SEARCH_PATHS)" mono --debug "$(ENGINE_DIRECTORY)/OpenRA.Utility.exe" $(MOD_ID) --check-yaml
169+
@./utility.sh --check-yaml
Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>net461</TargetFramework>
3+
<TargetFramework>net472</TargetFramework>
44
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
55
<Optimize>true</Optimize>
6-
<LangVersion>5</LangVersion>
6+
<LangVersion>7.3</LangVersion>
77
<DebugSymbols>true</DebugSymbols>
88
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
9-
<OutputPath>../mods/example</OutputPath>
9+
<OutputPath>../engine/bin</OutputPath>
1010
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
1111
<PlatformTarget>AnyCPU</PlatformTarget>
1212
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
@@ -21,17 +21,14 @@
2121
<Optimize>false</Optimize>
2222
</PropertyGroup>
2323
<ItemGroup>
24-
<Reference Include="Eluant">
25-
<HintPath>../engine/thirdparty/download/Eluant.dll</HintPath>
26-
<Private>False</Private>
27-
</Reference>
2824
<ProjectReference Include="../engine/OpenRA.Game/OpenRA.Game.csproj">
2925
<Private>False</Private>
3026
</ProjectReference>
3127
<ProjectReference Include="../engine/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj">
3228
<Private>False</Private>
3329
</ProjectReference>
3430
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" />
31+
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" PrivateAssets="All" />
3532
<AdditionalFiles Include="../engine/stylecop.json" />
3633
</ItemGroup>
3734
<Target Name="DisableAnalyzers" BeforeTargets="CoreCompile" Condition="'$(Configuration)'=='Release'">
@@ -40,4 +37,4 @@
4037
<Analyzer Remove="@(Analyzer)" />
4138
</ItemGroup>
4239
</Target>
43-
</Project>
40+
</Project>

launch-dedicated.cmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ if "!MOD_ID!" == "" goto badconfig
2828
if "!ENGINE_VERSION!" == "" goto badconfig
2929
if "!ENGINE_DIRECTORY!" == "" goto badconfig
3030

31-
if not exist %ENGINE_DIRECTORY%\OpenRA.Game.exe goto noengine
31+
if not exist %ENGINE_DIRECTORY%\bin\OpenRA.exe goto noengine
3232
>nul find %ENGINE_VERSION% %ENGINE_DIRECTORY%\VERSION || goto noengine
3333
cd %ENGINE_DIRECTORY%
3434

3535
:loop
36-
OpenRA.Server.exe Game.Mod=%MOD_ID% Server.Name=%Name% Server.ListenPort=%ListenPort% Server.AdvertiseOnline=%AdvertiseOnline% Server.EnableSingleplayer=%EnableSingleplayer% Server.Password=%Password% Server.RequireAuthentication=%RequireAuthentication% Server.ProfileIDBlacklist=%ProfileIDBlacklist% Server.ProfileIDWhitelist=%ProfileIDWhitelist% Server.EnableSyncReports=%EnableSyncReports% Server.EnableGeoIP=%EnableGeoIP% Server.ShareAnonymizedIPs=%ShareAnonymizedIPs% Engine.SupportDir=%SupportDir%
36+
bin\OpenRA.Server.exe Game.Mod=%MOD_ID% Engine.EngineDir=".." Server.Name=%Name% Server.ListenPort=%ListenPort% Server.AdvertiseOnline=%AdvertiseOnline% Server.EnableSingleplayer=%EnableSingleplayer% Server.Password=%Password% Server.RequireAuthentication=%RequireAuthentication% Server.ProfileIDBlacklist=%ProfileIDBlacklist% Server.ProfileIDWhitelist=%ProfileIDWhitelist% Server.EnableSyncReports=%EnableSyncReports% Server.EnableGeoIP=%EnableGeoIP% Server.ShareAnonymizedIPs=%ShareAnonymizedIPs% Engine.SupportDir=%SupportDir%
3737
goto loop
3838

3939
:noengine

launch-dedicated.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ fi
6666
cd "${ENGINE_DIRECTORY}"
6767

6868
while true; do
69-
MOD_SEARCH_PATHS="${MOD_SEARCH_PATHS}" mono --debug OpenRA.Server.exe Game.Mod="${LAUNCH_MOD}" \
69+
MOD_SEARCH_PATHS="${MOD_SEARCH_PATHS}" mono --debug bin/OpenRA.Server.exe Engine.EngineDir=".." Game.Mod="${LAUNCH_MOD}" \
7070
Server.Name="${NAME}" Server.ListenPort="${LISTEN_PORT}" \
7171
Server.AdvertiseOnline="${ADVERTISE_ONLINE}" \
7272
Server.Password="${PASSWORD}" \

launch-game.cmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ if "!ENGINE_VERSION!" == "" goto badconfig
1212
if "!ENGINE_DIRECTORY!" == "" goto badconfig
1313

1414
set TEMPLATE_DIR=%CD%
15-
if not exist %ENGINE_DIRECTORY%\OpenRA.Game.exe goto noengine
15+
if not exist %ENGINE_DIRECTORY%\bin\OpenRA.exe goto noengine
1616
>nul find %ENGINE_VERSION% %ENGINE_DIRECTORY%\VERSION || goto noengine
1717
cd %ENGINE_DIRECTORY%
1818

19-
OpenRA.Game.exe Game.Mod=%MOD_ID% Engine.LaunchPath="%TEMPLATE_LAUNCHER%" "Engine.ModSearchPaths=%MOD_SEARCH_PATHS%" "%*"
19+
bin\OpenRA.exe Game.Mod=%MOD_ID% Engine.EngineDir=".." Engine.LaunchPath="%TEMPLATE_LAUNCHER%" "Engine.ModSearchPaths=%MOD_SEARCH_PATHS%" "%*"
2020
set ERROR=%errorlevel%
2121
cd %TEMPLATE_DIR%
2222

launch-game.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ fi
3636
require_variables "MOD_ID" "ENGINE_VERSION" "ENGINE_DIRECTORY"
3737

3838
cd "${TEMPLATE_ROOT}"
39-
if [ ! -f "${ENGINE_DIRECTORY}/OpenRA.Game.exe" ] || [ "$(cat "${ENGINE_DIRECTORY}/VERSION")" != "${ENGINE_VERSION}" ]; then
39+
if [ ! -f "${ENGINE_DIRECTORY}/bin/OpenRA.exe" ] || [ "$(cat "${ENGINE_DIRECTORY}/VERSION")" != "${ENGINE_VERSION}" ]; then
4040
echo "Required engine files not found."
4141
echo "Run \`make\` in the mod directory to fetch and build the required files, then try again.";
4242
exit 1
4343
fi
4444

4545
cd "${ENGINE_DIRECTORY}"
46-
mono OpenRA.Game.exe Engine.LaunchPath="${TEMPLATE_LAUNCHER}" "Engine.ModSearchPaths=${MOD_SEARCH_PATHS}" Game.Mod="${MOD_ID}" "$@"
46+
mono --debug bin/OpenRA.exe Engine.EngineDir=".." Engine.LaunchPath="${TEMPLATE_LAUNCHER}" "Engine.ModSearchPaths=${MOD_SEARCH_PATHS}" Game.Mod="${MOD_ID}" "$@"

0 commit comments

Comments
 (0)