raylib/.github/workflows/linux.yml

80 lines
2.4 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-18 16:24:20 +03:00
RELEASE_NAME: raylib-3.1_linux_${{ matrix.ARCH_NAME }}
steps:
- name: Checkout code
uses: actions/checkout@master
- name: Setup Environment
run: |
2020-08-20 19:50:23 +03:00
sudo apt-get update -qq
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
- name: Check Environment
run: |
2020-08-20 19:50:23 +03:00
ls /usr/lib32/gcc
2020-08-20 18:45:28 +03:00
- name: Build Library (i386 or amd64)
2020-08-20 00:16:18 +03:00
run: |
cd src
2020-08-20 19:22:43 +03:00
make PLATFORM=PLATFORM_DESKTOP CC=${{ matrix.ARCH }}-linux-gnu-gcc RAYLIB_LIBTYPE=STATIC RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib"
make PLATFORM=PLATFORM_DESKTOP CC=${{ matrix.ARCH }}-linux-gnu-gcc RAYLIB_LIBTYPE=SHARED RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" -B
2020-08-20 00:16:18 +03:00
cd ..
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'