-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Major overhaul adding linux / 64 bit support + ci
- Now supports 64 bit version of win32 binary - Supports linux 32/64 - Minor improvements to code - Adds github action CI support
- Loading branch information
Showing
4 changed files
with
237 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,171 @@ | ||
name: Build gFwens (push to master) | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
|
||
paths-ignore: | ||
- "README.md" | ||
- 'examples/**' | ||
- ".gitignore" | ||
- ".github/workflows/build-master.yml" | ||
|
||
env: | ||
STEAMWORKS_LIB_BASEDIR: "./deps" | ||
|
||
jobs: | ||
|
||
fetch-dependencies: | ||
runs-on: ubuntu-18.04 | ||
env: | ||
STEAMWORKS_URL: ${{ secrets.STEAMWORKS_SDK_URL }} | ||
steps: | ||
- run: | | ||
wget https://github.com/premake/premake-core/releases/download/v5.0.0-alpha15/premake-5.0.0-alpha15-windows.zip -qO- | busybox unzip - | ||
wget $STEAMWORKS_URL -qO- | busybox unzip - | ||
wget https://github.com/premake/premake-core/releases/download/v5.0.0-alpha15/premake-5.0.0-alpha15-linux.tar.gz -qO- | tar zxf - | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: premake-persistence | ||
path: ./premake* | ||
|
||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: sdk-persistence | ||
path: ./sdk* | ||
|
||
### | ||
|
||
build-win: | ||
runs-on: windows-2019 | ||
needs: fetch-dependencies | ||
steps: | ||
|
||
- uses: actions/checkout@v2 | ||
with: | ||
repository: facepunch/gmod-module-base | ||
ref: refs/heads/development | ||
path: gmodheaders | ||
|
||
- uses: actions/checkout@v2 | ||
with: | ||
path: gfwens | ||
|
||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: premake-persistence | ||
path: gfwens | ||
|
||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: sdk-persistence | ||
path: gfwens/deps | ||
|
||
- uses: microsoft/setup-msbuild@v1.0.0 | ||
|
||
- run: | | ||
cd gfwens | ||
./premake5.exe vs2019 | ||
MSBuild.exe /p:Configuration=Release | ||
MSBuild.exe /p:Configuration=Release /property:Platform=x64 | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: gmsv_fwens_win32.dll | ||
path: gfwens\bin\release\gmsv_fwens_win32.dll | ||
|
||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: gmsv_fwens_win64.dll | ||
path: gfwens\bin\release\gmsv_fwens_win64.dll | ||
|
||
### | ||
|
||
build-linux: | ||
runs-on: ubuntu-18.04 | ||
needs: fetch-dependencies | ||
steps: | ||
|
||
- uses: actions/checkout@v2 | ||
with: | ||
repository: facepunch/gmod-module-base | ||
ref: refs/heads/development | ||
path: gmodheaders | ||
|
||
- uses: actions/checkout@v2 | ||
with: | ||
path: gfwens | ||
|
||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: premake-persistence | ||
path: gfwens | ||
|
||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: sdk-persistence | ||
path: gfwens/deps | ||
|
||
# We need multilib otherwise we'll get the wrong arch for *nix | ||
- run: | | ||
sudo apt install gcc-multilib g++-multilib -y | ||
cd gfwens | ||
chmod +x ./premake5 | ||
./premake5 gmake2 | ||
make config=release_x32 | ||
make config=release_x64 | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: gmsv_fwens_linux.dll | ||
path: gfwens/bin/release/gmsv_fwens_linux.dll | ||
|
||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: gmsv_fwens_linux64.dll | ||
path: gfwens/bin/release/gmsv_fwens_linux64.dll | ||
|
||
release: | ||
runs-on: ubuntu-18.04 | ||
needs: [build-win, build-linux] | ||
|
||
steps: | ||
|
||
- name: Get short hash | ||
id: gensha | ||
run: echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)" | ||
|
||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: gmsv_fwens_linux.dll | ||
|
||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: gmsv_fwens_linux64.dll | ||
|
||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: gmsv_fwens_win32.dll | ||
|
||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: gmsv_fwens_win64.dll | ||
|
||
- uses: ncipollo/release-action@v1 | ||
with: | ||
artifacts: "*.dll" | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
tag: ${{ steps.gensha.outputs.sha8 }} | ||
omitBody: true | ||
|
||
- uses: geekyeggo/delete-artifact@v1 | ||
with: | ||
name: | | ||
gmsv_fwens_win32.dll | ||
gmsv_fwens_win64.dll | ||
gmsv_fwens_linux.dll | ||
gmsv_fwens_linux64.dll | ||
premake-persistence | ||
sdk-persistence | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,75 @@ | ||
-- x64 is experimental and not guaranteed to work. Pending on gmod actually getting 64 bit support. | ||
-- win32 suffix doesn't change currently as we don't know what the plan will be for this. Similar to how | ||
-- linux / osx still get the .dll extension even though yknow, those are the wrong binary suffixes for those OS's | ||
|
||
platformAlias = { | ||
["windows"] = "win32", | ||
["linux"] = "linux", | ||
["macosx"] = "osx" | ||
} | ||
|
||
workspace "gfwens" | ||
workspace "gmsv_gfwens" | ||
configurations {"Debug", "Release"} | ||
platforms {"x32", "x64"} | ||
|
||
project "gmsv_gfwens" | ||
kind "SharedLib" | ||
language "C++" | ||
|
||
files { "src/*.cpp", "src/*.h" } | ||
|
||
includedirs { "../gmodheaders/include", "../steamworks" } | ||
targetname ("gmsv_fwens_" .. platformAlias[os.target()]) | ||
local gmodBaseDir = os.getenv("GMODHEADERS") or "" | ||
local steamworksBaseDir = os.getenv("STEAMWORKS_LIB_BASEDIR") or "" | ||
|
||
includedirs { "../gmodheaders/include", "../steamworks", gmodBaseDir, steamworksBaseDir} | ||
targetname ("gmsv_fwens") | ||
targetprefix "" | ||
targetextension ".dll" | ||
|
||
-- Debug | x32 / x64 | ||
filter { "configurations:Debug", "platforms:x32" } | ||
filter "configurations:Debug" | ||
defines { "DEBUG", "_CRT_SECURE_NO_WARNINGS" } | ||
links { "../steamworks/sdk/redistributable_bin/steam_api.lib"} | ||
symbols "On" | ||
targetdir "bin/x32/debug/" | ||
objdir "bin/x32/debug/" | ||
architecture "x32" | ||
targetdir "bin/debug/" | ||
objdir "bin/debug/" | ||
|
||
filter { "configurations:Debug","platforms:x64" } | ||
defines { "DEBUG", "_CRT_SECURE_NO_WARNINGS" } | ||
links { "../steamworks/sdk/redistributable_bin/win64/steam_api64.lib"} | ||
symbols "On" | ||
targetdir "bin/x64/debug/" | ||
objdir "bin/x64/debug/" | ||
architecture "x64" | ||
|
||
-- Release | x32 / x64 | ||
filter { "configurations:Release","platforms:x32" } | ||
filter "configurations:Release" | ||
defines { "NDEBUG", "_CRT_SECURE_NO_WARNINGS" } | ||
links { "../steamworks/sdk/redistributable_bin/steam_api.lib"} | ||
optimize "On" | ||
targetdir "bin/x32/release/" | ||
objdir "bin/x32/release/" | ||
symbols "off" | ||
architecture "x32" | ||
targetdir "bin/release/" | ||
objdir "bin/release/" | ||
|
||
filter { "configurations:Release", "platforms:x64" } | ||
defines { "NDEBUG", "_CRT_SECURE_NO_WARNINGS" } | ||
links { "../steamworks/sdk/redistributable_bin/win64/steam_api64.lib"} | ||
optimize "On" | ||
targetdir "bin/x64/release/" | ||
objdir "bin/x64/release/" | ||
symbols "off" | ||
architecture "x64" | ||
|
||
filter {"platforms:*32" } | ||
architecture "x86" | ||
|
||
filter {"platforms:*64" } | ||
architecture "x86_64" | ||
|
||
filter({"system:windows", "platforms:*32"}) | ||
targetsuffix("_win32") | ||
if steamworksBaseDir ~= "" then | ||
links {steamworksBaseDir .. "/sdk/redistributable_bin/steam_api.lib"} | ||
else | ||
links { "../steamworks/sdk/redistributable_bin/steam_api.lib"} | ||
end | ||
|
||
filter({"system:windows", "platforms:*64"}) | ||
targetsuffix("_win64") | ||
|
||
if steamworksBaseDir ~= "" then | ||
links {steamworksBaseDir .."/sdk/redistributable_bin/win64/steam_api64.lib"} | ||
else | ||
links { "../steamworks/sdk/redistributable_bin/win64/steam_api64.lib"} | ||
end | ||
|
||
filter({"system:linux", "platforms:*32"}) | ||
targetsuffix("_linux") | ||
if steamworksBaseDir ~= "" then | ||
libdirs {steamworksBaseDir .. "/sdk/redistributable_bin/linux32/"} | ||
else | ||
libdirs {"../steamworks/sdk/redistributable_bin/linux32/"} | ||
end | ||
links {"steam_api"} | ||
|
||
filter({"system:linux", "platforms:*64"}) | ||
targetsuffix("_linux64") | ||
|
||
if steamworksBaseDir ~= "" then | ||
libdirs {steamworksBaseDir .. "/sdk/redistributable_bin/linux64/"} | ||
else | ||
libdirs {"../steamworks/sdk/redistributable_bin/linux64/"} | ||
end | ||
links {"steam_api"} | ||
|
||
filter {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters