raylib/.github/workflows/linux.yml

89 lines
2.8 KiB
YAML
Raw Normal View History

2020-08-17 22:03:58 +03:00
name: Linux
2020-08-19 18:22:15 +03:00
on:
push:
pull_request:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 1
matrix:
bits: [32, 64]
include:
- bits: 32
2020-08-18 14:20:48 +03:00
ARCH: "x86"
2020-08-18 16:24:20 +03:00
ARCH_NAME: "i386"
- bits: 64
2020-08-18 14:20:48 +03:00
ARCH: "x64"
2020-08-18 16:24:20 +03:00
ARCH_NAME: "amd64"
env:
2020-08-18 16:24:20 +03:00
RELEASE_NAME: raylib-3.1_linux_${{ matrix.ARCH_NAME }}
steps:
- name: Checkout code
uses: actions/checkout@master
- name: Update System
run: sudo apt-get update -qq
- name: Setup Environment
run: |
mkdir build
cd build
2020-08-18 14:20:48 +03:00
mkdir ${{ env.RELEASE_NAME }}
cd ${{ env.RELEASE_NAME }}
mkdir include
mkdir lib
2020-08-18 14:20:48 +03:00
cd ../../../raylib
2020-08-18 15:45:17 +03:00
sudo apt-get install gcc-multilib lib32gcc-7-dev
sudo apt-get install -y --no-install-recommends libglfw3 libglfw3-dev libx11-dev libxcursor-dev libxrandr-dev libxinerama-dev libxi-dev libxext-dev libxfixes-dev
2020-08-19 18:22:15 +03:00
# TODO: Review i386 shared library building or remove it
2020-08-20 00:16:18 +03:00
- name: Build Library i386
run: |
cd src
gcc -v
make PLATFORM=PLATFORM_DESKTOP CC=gcc RAYLIB_BUILD_ARCH=${{ matrix.ARCH }} RAYLIB_LIBTYPE=STATIC RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib"
# make PLATFORM=PLATFORM_DESKTOP CC=gcc RAYLIB_BUILD_ARCH=${{ matrix.ARCH }} RAYLIB_LIBTYPE=SHARED RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" -B
cd ..
if: matrix.bits == 32
- name: Build Library amd64
run: |
cd src
2020-08-18 14:20:48 +03:00
gcc -v
2020-08-18 16:21:42 +03:00
make PLATFORM=PLATFORM_DESKTOP CC=gcc RAYLIB_BUILD_ARCH=${{ matrix.ARCH }} RAYLIB_LIBTYPE=STATIC RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib"
2020-08-18 15:03:05 +03:00
make clean
2020-08-18 16:21:42 +03:00
make PLATFORM=PLATFORM_DESKTOP CC=gcc RAYLIB_BUILD_ARCH=${{ matrix.ARCH }} RAYLIB_LIBTYPE=SHARED RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" -B
cd ..
2020-08-20 00:16:18 +03:00
if: matrix.bits == 64
2020-08-17 22:05:42 +03:00
- name: Generate Artifacts
run: |
2020-08-18 14:20:48 +03:00
cp -v ./src/raylib.h ./build/${{ env.RELEASE_NAME }}/include
cd build
2020-08-18 16:21:42 +03:00
tar -czvf ${{ env.RELEASE_NAME }}.tar.gz ${{ env.RELEASE_NAME }}
2020-08-17 22:05:42 +03:00
- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
2020-08-18 14:20:48 +03:00
name: ${{ env.RELEASE_NAME }}.tar.gz
2020-08-18 15:03:05 +03:00
path: ./build/${{ env.RELEASE_NAME }}.tar.gz
2020-08-19 18:22:15 +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 }}
2020-08-19 19:47:58 +03:00
asset_path: ./build/${{ env.RELEASE_NAME }}.tar.gz
asset_name: ${{ env.RELEASE_NAME }}.tar.gz
asset_content_type: application/gzip
2020-08-19 18:22:15 +03:00
if: github.event_name == 'release' && github.event.action == 'published'