Skip to content

Commit

Permalink
HTTP functionality
Browse files Browse the repository at this point in the history
To be used with JSON format, all JSON encoding/decoding must be done in Lua.
  • Loading branch information
leiizko authored Aug 19, 2021
1 parent 837c792 commit 3334ab7
Show file tree
Hide file tree
Showing 8 changed files with 1,534 additions and 1,025 deletions.
97 changes: 97 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: build

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
linux:
name: Linux
runs-on: ubuntu-18.04

steps:
- name: Checkout server
uses: actions/checkout@v2
with:
repository: callofduty4x/CoD4x_Server
path: server

- name: Set up needed libs
run: |
sudo apt-get install g++-multilib gcc-multilib
sudo dpkg --add-architecture i386
sudo apt-get install nasm:i386 paxctl:i386 libtommath-dev:i386
wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.16.tar.gz
sudo tar -zxvf libiconv-1.16.tar.gz
cd libiconv-1.16
sudo ./configure --prefix=/usr/local --host=i686-linux-gnu "CFLAGS=-m32" "CXXFLAGS=-m32" "LDFLAGS=-m32"
sudo make
sudo make install
sudo ln -s /usr/local/lib/libiconv.so.2 /usr/lib/libiconv.so.2
sudo ldconfig
- name: Checkout plugin
uses: actions/checkout@v2
with:
repository: leiizko/cod4x_lua_plugin
path: server/plugins/lua

- name: Build plugin
run: |
cd server/plugins/lua
make ICONV=true
windows:
name: Windows
runs-on: windows-latest

steps:
- name: Get MinGW (i686-8.1.0-release-posix-dwarf)
run: |
$Uri = "https://downloads.sourceforge.net/mingw-w64/i686-8.1.0-release-posix-dwarf-rt_v6-rev0.7z"
$filename = "mingw32.7z"
cd C:/
Start-BitsTransfer -Source $Uri -Destination $filename
7z x $filename
- name: Get NASM
uses: ilammy/setup-nasm@v1

- name: Checkout server
uses: actions/checkout@v2
with:
repository: callofduty4x/CoD4x_Server
path: server

- name: Get pexports
run: |
cd server
Invoke-WebRequest "https://github.com/callofduty4x/CoD4x_Server/raw/master/tools/pexports-0.47-mingw32-bin.tar.xz" -OutFile "pexports.tar.xz"
7z x pexports.tar.xz
7z x pexports.tar
- name: Build server
run: |
$path = $env:Path
$env:Path = "C:\mingw32\bin;"
$env:Path += $path
cd server
mingw32-make
- name: Checkout plugin
uses: actions/checkout@v2
with:
repository: leiizko/cod4x_lua_plugin
path: server/plugins/lua

- name: Build plugin
run: |
$path = $env:Path
$env:Path = "C:\mingw32\bin;"
$env:Path += $path
cd server/plugins/lua
mingw32-make ICONV=true
107 changes: 107 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
name: release

on:
release:
types: [created]

jobs:
linux:
name: Linux
runs-on: ubuntu-18.04

steps:
- name: Checkout server
uses: actions/checkout@v2
with:
repository: callofduty4x/CoD4x_Server
path: server

- name: Set up needed libs
run: |
sudo apt-get install g++-multilib gcc-multilib
sudo dpkg --add-architecture i386
sudo apt-get install nasm:i386 paxctl:i386 libtommath-dev:i386
wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.16.tar.gz
sudo tar -zxvf libiconv-1.16.tar.gz
cd libiconv-1.16
sudo ./configure --prefix=/usr/local --host=i686-linux-gnu "CFLAGS=-m32" "CXXFLAGS=-m32" "LDFLAGS=-m32"
sudo make
sudo make install
sudo ln -s /usr/local/lib/libiconv.so.2 /usr/lib/libiconv.so.2
sudo ldconfig
- name: Checkout plugin
uses: actions/checkout@v2
with:
repository: leiizko/cod4x_lua_plugin
path: server/plugins/lua

- name: Build plugin
run: |
cd server/plugins/lua
make ICONV=true
- name: Publish
uses: ncipollo/release-action@v1
with:
allowUpdates: true
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: "server/plugins/lua/lua.so"

windows:
name: Windows
runs-on: windows-latest

steps:
- name: Get MinGW (i686-8.1.0-release-posix-dwarf)
run: |
$Uri = "https://downloads.sourceforge.net/mingw-w64/i686-8.1.0-release-posix-dwarf-rt_v6-rev0.7z"
$filename = "mingw32.7z"
cd C:/
Start-BitsTransfer -Source $Uri -Destination $filename
7z x $filename
- name: Get NASM
uses: ilammy/setup-nasm@v1

- name: Checkout server
uses: actions/checkout@v2
with:
repository: callofduty4x/CoD4x_Server
path: server

- name: Get pexports
run: |
cd server
Invoke-WebRequest "https://github.com/callofduty4x/CoD4x_Server/raw/master/tools/pexports-0.47-mingw32-bin.tar.xz" -OutFile "pexports.tar.xz"
7z x pexports.tar.xz
7z x pexports.tar
- name: Build server
run: |
$path = $env:Path
$env:Path = "C:\mingw32\bin;"
$env:Path += $path
cd server
mingw32-make
- name: Checkout plugin
uses: actions/checkout@v2
with:
repository: leiizko/cod4x_lua_plugin
path: server/plugins/lua

- name: Build plugin
run: |
$path = $env:Path
$env:Path = "C:\mingw32\bin;"
$env:Path += $path
cd server/plugins/lua
mingw32-make ICONV=true
- name: Publish
uses: ncipollo/release-action@v1
with:
allowUpdates: true
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: "server/plugins/lua/lua.dll"
Loading

0 comments on commit 3334ab7

Please sign in to comment.