Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
diamante0018 committed Jan 13, 2024
0 parents commit 095e3e8
Show file tree
Hide file tree
Showing 37 changed files with 2,372 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
updates:
- package-ecosystem: gitsubmodule
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
162 changes: 162 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
name: Build

on:
push:
branches:
- "*"
pull_request:
branches:
- "*"
types: [opened, synchronize, reopened]

env:
PREMAKE_VERSION: "5.0.0-beta2"

concurrency:
group: ${{ github.ref }}
cancel-in-progress: true

jobs:
build-win:
name: Build Windows
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
configuration:
- debug
- release
arch:
- x64
include:
- arch: x64
platform: x64
steps:
- name: Check out files
uses: actions/checkout@main
with:
submodules: true
fetch-depth: 0
# NOTE - If LFS ever starts getting used during builds, switch this to true!
lfs: false

- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@main

- name: Install Premake5
uses: abel0b/[email protected]
with:
version: ${{ env.PREMAKE_VERSION }}

- name: Generate project files
run: premake5 vs2022

- name: Set up problem matching
uses: ammaraskar/msvc-problem-matcher@master

- name: Build ${{matrix.arch}} ${{matrix.configuration}} binaries
run: msbuild /m /v:minimal /p:Configuration=${{matrix.configuration}} /p:Platform=${{matrix.platform}} build/aw-installer.sln

- name: Upload ${{matrix.arch}} ${{matrix.configuration}} binaries
uses: actions/upload-artifact@main
with:
name: windows-${{matrix.arch}}-${{matrix.configuration}}
path: |
build/bin/${{matrix.arch}}/${{matrix.configuration}}/aw-installer.exe
build/bin/${{matrix.arch}}/${{matrix.configuration}}/aw-installer.pdb
build-linux:
name: Build Linux
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
configuration:
- debug
- release
arch:
- x64
steps:
- name: Check out files
uses: actions/checkout@main
with:
submodules: true
fetch-depth: 0
# NOTE - If LFS ever starts getting used during builds, switch this to true!
lfs: false

- name: Install dependencies (x64)
if: matrix.arch == 'x64'
run: |
sudo apt-get update
sudo apt-get install libcurl4-gnutls-dev -y
- name: Install Premake5
uses: abel0b/[email protected]
with:
version: ${{ env.PREMAKE_VERSION }}

- name: Generate project files
run: premake5 --cc=clang gmake2

- name: Set up problem matching
uses: ammaraskar/gcc-problem-matcher@master

- name: Build ${{matrix.arch}} ${{matrix.configuration}} binaries
run: |
pushd build
make config=${{matrix.configuration}}_${{matrix.arch}} -j$(nproc)
env:
CC: clang
CXX: clang++

- name: Upload ${{matrix.arch}} ${{matrix.configuration}} binaries
uses: actions/upload-artifact@main
with:
name: linux-${{matrix.arch}}-${{matrix.configuration}}
path: |
build/bin/${{matrix.arch}}/${{matrix.configuration}}/aw-installer
build-macos:
name: Build macOS
runs-on: macos-13
strategy:
fail-fast: false
matrix:
configuration:
- debug
- release
arch:
- x64
- arm64
steps:
- name: Check out files
uses: actions/checkout@main
with:
submodules: true
fetch-depth: 0
# NOTE - If LFS ever starts getting used during builds, switch this to true!
lfs: false

- name: Install Premake5
uses: abel0b/[email protected]
with:
version: ${{ env.PREMAKE_VERSION }}

- name: Generate project files
run: premake5 gmake2

- name: Set up problem matching
uses: ammaraskar/gcc-problem-matcher@master

- name: Build ${{matrix.arch}} ${{matrix.configuration}} binaries
run: |
pushd build
make config=${{matrix.configuration}}_${{matrix.arch}} -j$(sysctl -n hw.logicalcpu)
- name: Upload ${{matrix.arch}} ${{matrix.configuration}} binaries
uses: actions/[email protected]
with:
name: macos-${{matrix.arch}}-${{matrix.configuration}}
path: |
build/bin/${{matrix.arch}}/${{matrix.configuration}}/aw-installer
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Build results
build
13 changes: 13 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[submodule "deps/GSL"]
path = deps/GSL
url = https://github.com/microsoft/GSL.git
[submodule "deps/curl"]
path = deps/curl
url = https://github.com/curl/curl.git
branch = curl-8_5_0
[submodule "deps/rapidjson"]
path = deps/rapidjson
url = https://github.com/Tencent/rapidjson.git
[submodule "deps/zlib"]
path = deps/zlib
url = https://github.com/madler/zlib.git
29 changes: 29 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
BSD 3-Clause License

Copyright (c) 2024, AlterWare
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[![build](https://github.com/alterware/aw-installer/workflows/Build/badge.svg)](https://github.com/alterware/aw-installer/actions)


# AlterWare: Installer
This is the tool we use to pull changes made from the release page of some of our clients and install it where we need to.

## Build
- Install [Premake5](premake5-link) and add it to your system PATH
- Clone this repository using [Git][git-link]
- Update the submodules using ``git submodule update --init --recursive``
- Run Premake with either of these two options ``premake5 vs2022`` (Windows) or ``premake5 gmake2`` (Linux/macOS)

**IMPORTANT**
Requirements for Unix systems:
- Compilation: Please use Clang as the preferred compiler
- Dependencies: Ensure the LLVM C++ Standard library is installed
- Alternative compilers: If you opt for a different compiler such as GCC, use the [Mold][mold-link] linker
- Customization: Modifications to the Premake5.lua script may be required
- Platform support: Details regarding supported platforms are available in [build.yml][build-link]

[premake5-link]: https://premake.github.io
[git-link]: https://git-scm.com
[mold-link]: https://github.com/rui314/mold
[build-link]: https://github.com/alterware/master-server/blob/master/.github/workflows/build.yml
1 change: 1 addition & 0 deletions deps/GSL
Submodule GSL added at e64c97
1 change: 1 addition & 0 deletions deps/curl
Submodule curl added at 7161cb
75 changes: 75 additions & 0 deletions deps/premake/curl.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
curl = {
source = path.join(dependencies.basePath, "curl"),
}

function curl.import()
links { "curl" }

filter "toolset:msc*"
links { "Crypt32.lib" }
filter {}

curl.includes()
end

function curl.includes()
filter "toolset:msc*"
includedirs {
path.join(curl.source, "include"),
}

defines {
"CURL_STRICTER",
"CURL_STATICLIB",
"CURL_DISABLE_LDAP",
}
filter {}
end

function curl.project()
if not os.istarget("windows") then
return
end

project "curl"
language "C"

curl.includes()

includedirs {
path.join(curl.source, "lib"),
}

files {
path.join(curl.source, "lib/**.c"),
path.join(curl.source, "lib/**.h"),
}

defines {
"BUILDING_LIBCURL",
}

filter "toolset:msc*"

defines {
"USE_SCHANNEL",
"USE_WINDOWS_SSPI",
"USE_THREADS_WIN32",
}

filter {}

filter "toolset:not msc*"

defines {
"USE_GNUTLS",
"USE_THREADS_POSIX",
}

filter {}

warnings "Off"
kind "StaticLib"
end

table.insert(dependencies, curl)
19 changes: 19 additions & 0 deletions deps/premake/gsl.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
gsl = {
source = path.join(dependencies.basePath, "GSL"),
}

function gsl.import()
gsl.includes()
end

function gsl.includes()
includedirs {
path.join(gsl.source, "include")
}
end

function gsl.project()

end

table.insert(dependencies, gsl)
50 changes: 50 additions & 0 deletions deps/premake/minizip.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
minizip = {
source = path.join(dependencies.basePath, "zlib/contrib/minizip"),
}

function minizip.import()
links { "minizip" }
zlib.import()
minizip.includes()
end

function minizip.includes()
includedirs {
minizip.source
}

zlib.includes()
end

function minizip.project()
project "minizip"
language "C"
cdialect "C89"

minizip.includes()

files {
path.join(minizip.source, "*.h"),
path.join(minizip.source, "*.c"),
}

filter "system:not windows"
removefiles {
path.join(minizip.source, "iowin32.c"),
}
filter {}

removefiles {
path.join(minizip.source, "miniunz.c"),
path.join(minizip.source, "minizip.c"),
}

filter { "system:windows" }
defines "_CRT_SECURE_NO_DEPRECATE"
filter {}

warnings "Off"
kind "StaticLib"
end

table.insert(dependencies, minizip)
Loading

0 comments on commit 095e3e8

Please sign in to comment.