-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
86 additions
and
0 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,86 @@ | ||
name: Build | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- "*" | ||
- "*/*" | ||
- "**" | ||
pull_request: | ||
branches: | ||
- "*" | ||
- "*/*" | ||
- "**" | ||
env: | ||
PLUGIN_VERSION: 1.5.1 | ||
|
||
jobs: | ||
build-windows-release: | ||
runs-on: windows-2019 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
clean: true | ||
submodules: recursive | ||
fetch-depth: 0 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v2 | ||
|
||
- name: Install CMake | ||
uses: lukka/[email protected] | ||
|
||
- name: Generate build files | ||
run: | | ||
mkdir build | ||
cd build | ||
cmake -DCMAKE_BUILD_TYPE=Release .. -G "Visual Studio 16 2019" -A Win32 | ||
cmake --build . --config Release | ||
- name: Upload artifacts (part 1) | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: pawnraknet-${{ env.PLUGIN_VERSION }}-win32 | ||
path: build/Release/pawnraknet.dll | ||
|
||
- name: Upload artifacts (part 2) | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: pawnraknet-${{ env.PLUGIN_VERSION }}-win32 | ||
path: src/Pawn.RakNet.inc | ||
|
||
build-linux-release: | ||
runs-on: ubuntu-18.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
clean: true | ||
submodules: recursive | ||
fetch-depth: 0 | ||
|
||
- name: Install packages | ||
run: sudo apt-get install g++-multilib | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v2 | ||
|
||
- name: Install CMake | ||
uses: lukka/[email protected] | ||
|
||
- name: Generate build files | ||
run: mkdir build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS=-m32 -DCMAKE_CXX_FLAGS=-m32 | ||
|
||
- name: Build | ||
run: | | ||
cd build | ||
cmake --build . --config Release | ||
- name: Create artifact | ||
run: tar -czf pawnraknet-$PLUGIN_VERSION-linux.tar.gz -C build pawnraknet.so -C ../src Pawn.RakNet.inc | ||
|
||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: pawnraknet-${{ env.PLUGIN_VERSION }}-linux | ||
path: pawnraknet-${{ env.PLUGIN_VERSION }}-linux.tar.gz |