Update Lua and SDL2 #95
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
name: 'Linux' | |
env: | |
DEPLOY_FILE_NOEXT: nCine-external-OS-COMPILER-VERSION | |
DEPLOY_MESSAGE: | |
"Push artifact from GitHub Actions build ${{ github.run_number }} with id ${{ github.run_id }} | |
- nCine-libraries artifact from branch 'BRANCH_NAME' with commit id ${{ github.sha }}" | |
DEPLOY_BRANCH: libraries-OS-COMPILER | |
on: [push, workflow_dispatch] | |
jobs: | |
Linux: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- BuildType: Debug | |
CC: gcc | |
CXX: g++ | |
- BuildType: Release | |
CC: gcc | |
CXX: g++ | |
- BuildType: Debug | |
CC: clang | |
CXX: clang++ | |
- BuildType: Release | |
CC: clang | |
CXX: clang++ | |
runs-on: 'ubuntu-22.04' | |
steps: | |
- name: 'Checkout code' | |
uses: actions/checkout@v4 | |
- name: 'Install Build Dependencies' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libwayland-dev libgl1-mesa-dev libxkbcommon-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libasound2-dev libpulse-dev | |
- name: 'CMake Configuration' | |
run: | | |
export CC=${{ matrix.CC }} | |
export CXX=${{ matrix.CXX }} | |
cmake -B ../nCine-libraries-build -D CMAKE_BUILD_TYPE=${{ matrix.BuildType }} | |
- name: 'Make' | |
run: | | |
make -j2 -C ../nCine-libraries-build | |
- name: 'Push Artifacts' | |
if: matrix.BuildType == 'Release' | |
env: | |
PUBLIC_REPO_TOKEN: ${{ secrets.PUBLIC_REPO_TOKEN }} | |
run: | | |
git config --global user.email "actions@github.com" | |
git config --global user.name "GitHub Actions" | |
export BRANCH_NAME=$(git describe --tags --exact-match 2> /dev/null || git symbolic-ref -q --short HEAD || git rev-parse --short HEAD) | |
export DEPLOY_MESSAGE=`sed 's/BRANCH_NAME/'"$BRANCH_NAME"'/' <<< "$DEPLOY_MESSAGE"` | |
export OS=linux | |
export CC=${{ matrix.CC }} | |
git fetch --unshallow || true | |
export GIT_VERSION=$(set -o pipefail; git describe --tags --long 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' || printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)";) | |
cd .. | |
export DEPLOY_FILE=$DEPLOY_FILE_NOEXT.tar.gz | |
export DEPLOY_FILE=`echo $DEPLOY_FILE | sed 's/OS/'"$OS"'/'` | |
export DEPLOY_FILE=`echo $DEPLOY_FILE | sed 's/COMPILER/'"$CC"'/'` | |
export DEPLOY_FILE=`echo $DEPLOY_FILE | sed 's/VERSION/'"$GIT_VERSION"'/'` | |
tar cpzf $DEPLOY_FILE nCine-external | |
export DEPLOY_BRANCH=`echo $DEPLOY_BRANCH | sed 's/OS/'"$OS"'/'` | |
export DEPLOY_BRANCH=`echo $DEPLOY_BRANCH | sed 's/COMPILER/'"$CC"'/'` | |
git clone https://$PUBLIC_REPO_TOKEN@github.com/nCine/nCine-libraries-artifacts.git >/dev/null 2>&1 | |
cd nCine-libraries-artifacts | |
git checkout $DEPLOY_BRANCH || git checkout --orphan $DEPLOY_BRANCH | |
git reset | |
git clean -f | |
git rm * || true | |
mv -f ../$DEPLOY_FILE . | |
git add $DEPLOY_FILE | |
git commit --amend -m "$DEPLOY_MESSAGE" || git commit -m "$DEPLOY_MESSAGE" | |
git push --force || git push --set-upstream origin $DEPLOY_BRANCH |