2020-08-17 21:40:17 +03:00
|
|
|
name: Windows
|
|
|
|
|
2020-08-18 14:51:25 +03:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
pull_request:
|
|
|
|
release:
|
|
|
|
types: [published]
|
2020-08-17 21:40:17 +03:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: windows-latest
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
max-parallel: 1
|
|
|
|
matrix:
|
|
|
|
compiler: [mingw-w64, msvc16]
|
|
|
|
bits: [32, 64]
|
|
|
|
include:
|
|
|
|
- compiler: mingw-w64
|
|
|
|
bits: 32
|
2020-08-20 13:07:13 +03:00
|
|
|
ARCH: "x86"
|
2020-08-20 13:34:10 +03:00
|
|
|
COMPILER_NAME: "i686-w64-mingw32-gcc.exe"
|
2020-08-17 21:40:17 +03:00
|
|
|
- compiler: mingw-w64
|
|
|
|
bits: 64
|
2020-08-18 00:26:28 +03:00
|
|
|
ARCH: "x64"
|
2020-08-20 13:34:10 +03:00
|
|
|
COMPILER_NAME: "x86_64-w64-mingw32-gcc.exe"
|
2020-08-17 21:40:17 +03:00
|
|
|
- compiler: msvc16
|
|
|
|
bits: 32
|
2020-08-18 14:00:59 +03:00
|
|
|
ARCH: "x86"
|
|
|
|
VSBINPATH: "Win32"
|
2020-08-17 21:40:17 +03:00
|
|
|
- compiler: msvc16
|
|
|
|
bits: 64
|
|
|
|
ARCH: "x64"
|
2020-08-18 14:00:59 +03:00
|
|
|
VSBINPATH: "x64"
|
|
|
|
|
|
|
|
env:
|
|
|
|
RELEASE_NAME: raylib-3.1_win${{ matrix.bits }}_${{ matrix.compiler }}
|
2020-08-17 21:40:17 +03:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@master
|
|
|
|
|
|
|
|
- name: Setup Environment
|
|
|
|
run: |
|
2020-08-17 22:42:37 +03:00
|
|
|
dir
|
2020-08-17 21:40:17 +03:00
|
|
|
mkdir build
|
|
|
|
cd build
|
2020-08-18 14:00:59 +03:00
|
|
|
mkdir ${{ env.RELEASE_NAME }}
|
|
|
|
cd ${{ env.RELEASE_NAME }}
|
2020-08-17 21:40:17 +03:00
|
|
|
mkdir include
|
2020-08-18 14:00:59 +03:00
|
|
|
mkdir lib
|
2020-08-17 22:10:34 +03:00
|
|
|
cd ../../../raylib
|
2020-08-17 21:40:17 +03:00
|
|
|
|
|
|
|
# Setup MSBuild.exe path if required
|
2020-08-17 21:46:25 +03:00
|
|
|
- name: Setup MSBuild
|
|
|
|
uses: microsoft/setup-msbuild@v1.0.1
|
2020-08-17 21:40:17 +03:00
|
|
|
if: matrix.compiler == 'msvc16'
|
|
|
|
|
2020-08-20 00:13:48 +03:00
|
|
|
# TODO: Compile resource file raylib.dll.rc for linkage on raylib.dll generation
|
|
|
|
- name: Build Library (MinGW-w64)
|
|
|
|
run: |
|
|
|
|
cd src
|
2020-08-20 13:34:10 +03:00
|
|
|
${{ matrix.COMPILER_NAME }} -v
|
|
|
|
make PLATFORM=PLATFORM_DESKTOP CC=${{ matrix.COMPILER_NAME }} RAYLIB_BUILD_ARCH=${{ matrix.ARCH }} RAYLIB_LIBTYPE=STATIC RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib"
|
|
|
|
make PLATFORM=PLATFORM_DESKTOP CC=${{ matrix.COMPILER_NAME }} RAYLIB_BUILD_ARCH=${{ matrix.ARCH }} RAYLIB_LIBTYPE=SHARED RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" -B
|
2020-08-20 00:13:48 +03:00
|
|
|
cd ..
|
|
|
|
shell: cmd
|
2020-08-20 13:34:10 +03:00
|
|
|
if: matrix.compiler == 'mingw-w64' && matrix.bits == 32
|
|
|
|
|
2020-08-17 22:07:03 +03:00
|
|
|
- name: Build Library (MSVC16)
|
2020-08-17 21:40:17 +03:00
|
|
|
run: |
|
|
|
|
cd projects/VS2017
|
2020-08-18 00:41:17 +03:00
|
|
|
msbuild.exe raylib.sln /target:raylib /property:Configuration=Release /property:Platform=${{ matrix.ARCH }}
|
2020-08-18 14:00:59 +03:00
|
|
|
copy /Y .\bin\${{ matrix.VSBINPATH }}\Release\raylib.lib .\..\..\build\${{ env.RELEASE_NAME }}\lib\raylib.lib
|
2020-08-18 01:15:33 +03:00
|
|
|
msbuild.exe raylib.sln /target:raylib /property:Configuration=Release.DLL /property:Platform=${{ matrix.ARCH }}
|
2020-08-18 14:00:59 +03:00
|
|
|
copy /Y .\bin\${{ matrix.VSBINPATH }}\Release.DLL\raylib.dll .\..\..\build\${{ env.RELEASE_NAME }}\lib\raylib.dll
|
|
|
|
copy /Y .\bin\${{ matrix.VSBINPATH }}\Release.DLL\raylib.lib .\..\..\build\${{ env.RELEASE_NAME }}\lib\raylibdll.lib
|
2020-08-17 21:40:17 +03:00
|
|
|
cd ../..
|
2020-08-18 01:24:53 +03:00
|
|
|
shell: cmd
|
2020-08-17 21:40:17 +03:00
|
|
|
if: matrix.compiler == 'msvc16'
|
|
|
|
|
2020-08-17 22:07:03 +03:00
|
|
|
- name: Generate Artifacts
|
2020-08-17 21:40:17 +03:00
|
|
|
run: |
|
2020-08-18 14:00:59 +03:00
|
|
|
copy /Y .\src\raylib.h .\build\${{ env.RELEASE_NAME }}\include\raylib.h
|
2020-08-18 00:41:17 +03:00
|
|
|
cd build
|
2020-08-18 14:00:59 +03:00
|
|
|
7z a ./${{ env.RELEASE_NAME }}.zip ./${{ env.RELEASE_NAME }}
|
2020-08-18 01:39:57 +03:00
|
|
|
dir
|
2020-08-18 01:24:53 +03:00
|
|
|
shell: cmd
|
2020-08-17 21:40:17 +03:00
|
|
|
|
2020-08-17 22:07:03 +03:00
|
|
|
- name: Upload Artifacts
|
|
|
|
uses: actions/upload-artifact@v2
|
2020-08-17 21:40:17 +03:00
|
|
|
with:
|
2020-08-18 14:00:59 +03:00
|
|
|
name: ${{ env.RELEASE_NAME }}.zip
|
|
|
|
path: ./build/${{ env.RELEASE_NAME }}.zip
|
2020-08-18 14:51:25 +03:00
|
|
|
|
|
|
|
- name: Upload Artifact to Release
|
|
|
|
uses: actions/upload-release-asset@v1.0.1
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
|
|
|
upload_url: ${{ github.event.release.upload_url }}
|
|
|
|
asset_path: ./build/${{ env.RELEASE_NAME }}.zip
|
|
|
|
asset_name: ${{ env.RELEASE_NAME }}.zip
|
|
|
|
asset_content_type: application/zip
|
2020-08-18 15:07:55 +03:00
|
|
|
if: github.event_name == 'release' && github.event.action == 'published'
|
2020-08-18 14:51:25 +03:00
|
|
|
|