raylib/.github/workflows/linux.yml

93 lines
3.0 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-20 19:31:16 +03:00
ARCH: "i386"
2020-08-18 16:24:20 +03:00
ARCH_NAME: "i386"
2020-08-20 19:11:44 +03:00
COMPILER_PATH: "/user/bin"
- bits: 64
2020-08-20 18:45:28 +03:00
ARCH: "x86_64"
2020-08-20 19:11:44 +03:00
ARCH_NAME: "amd64"
COMPILER_PATH: "/user/bin"
env:
2020-08-21 14:16:32 +03:00
RELEASE_NAME: raylib-dev_linux_${{ matrix.ARCH_NAME }}
steps:
- name: Checkout code
uses: actions/checkout@master
2020-08-21 14:16:32 +03:00
- name: Setup Release Version
run: |
echo "::set-env name=RELEASE_NAME::raylib-${{ github.event.release.tag_name }}_linux_${{ matrix.ARCH_NAME }}"
shell: bash
if: github.event_name == 'release' && github.event.action == 'published'
- name: Setup Environment
run: |
2020-08-20 19:50:23 +03:00
sudo apt-get update -qq
2020-08-20 20:05:17 +03:00
sudo apt-get install gcc-multilib
2020-08-20 19:50:23 +03:00
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
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-20 19:37:38 +03:00
# ${{ matrix.ARCH }}-linux-gnu-gcc -v
2020-08-20 20:30:05 +03:00
# TODO: Support 32bit (i386) shared library building
- name: Build Library
run: |
cd src
make PLATFORM=PLATFORM_DESKTOP CC=gcc RAYLIB_LIBTYPE=STATIC RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" CFLAGS="-m32"
# make PLATFORM=PLATFORM_DESKTOP CC=gcc RAYLIB_LIBTYPE=SHARED RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" -B
cd ..
if: matrix.bits == 32
2020-08-20 20:13:59 +03:00
- name: Build Library
2020-08-20 00:16:18 +03:00
run: |
cd src
2020-08-20 20:21:51 +03:00
make PLATFORM=PLATFORM_DESKTOP CC=gcc RAYLIB_LIBTYPE=STATIC RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib"
make PLATFORM=PLATFORM_DESKTOP CC=gcc RAYLIB_LIBTYPE=SHARED RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" -B
2020-08-20 00:16:18 +03:00
cd ..
2020-08-20 20:30:05 +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'