Files
mlpack/.github/workflows/update-boost-version.yaml
T

82 lines
3.0 KiB
YAML

name: Update Boost Version
on:
workflow_dispatch:
schedule:
- cron: '0 10 * * *'
jobs:
updateBoostVersion:
if: ${{ github.repository == 'mlpack/mlpack' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Build Dependencies
run: |
sudo apt-get update
sudo apt-get install -y --allow-unauthenticated libopenblas-dev liblapack-dev g++ libboost-all-dev libcereal-dev libstb-dev libensmallen-dev
curl -L https://sourceforge.net/projects/arma/files/armadillo-9.800.6.tar.xz | tar -xvJ && cd armadillo*
cmake . && make && sudo make install && cd .. && rm -r armadillo*
- name: Get Latest Boost Tagged Release
id: boost-version
run: |
# CMake for extracting present boost version.
mkdir build && cd build
cmake ..
# Ping version information upstream.
BOOST_RELEASE_JSON=$(curl -sL https://api.github.com/repos/boostorg/boost/tags)
FOUND_NEW="NO"
# Compare present and upstream boost version.
for i in `jq -r .[].name <<< "$BOOST_RELEASE_JSON" | awk '!/.beta/' | \
grep -Po "(\d+\.)+\d+"`
do
FOUND_SIMILAR="NO"
for j in `grep Boost_ADDITIONAL_VERSIONS_LAST CMakeCache.txt | \
cut -d "=" -f2 | sed "s/;/ /g"`
do
if [[ "$i" == "$j" ]];
then
FOUND_SIMILAR="YES"
break
fi
done
if [[ "$FOUND_SIMILAR" != "YES" ]];
then
FOUND_NEW="YES"
BOOST_VERSION="$BOOST_VERSION\"$i\" "
fi
FOUND_SIMILAR="NO"
for j in `grep Boost_ADDITIONAL_VERSIONS_LAST CMakeCache.txt | \
cut -d "=" -f2 | sed "s/;/ /g"`
do
if [[ $(echo $i | grep -Po "(\d+)\.\d+") == "$j" ]];
then
FOUND_SIMILAR="YES"
break
fi
done
if [[ "$FOUND_SIMILAR" != "YES" ]];
then
FOUND_NEW="YES"
BOOST_VERSION="$BOOST_VERSION\"$(echo $i | grep -Po "(\d+)\.\d+")\" "
fi
done
# If found the new boost version, then update the CMake script.
if [[ "$FOUND_NEW" == "YES" ]]
then
sed --in-place "s/set(Boost_ADDITIONAL_VERSIONS/set(Boost_ADDITIONAL_VERSIONS\n ${BOOST_VERSION: : -1}/" ../CMakeLists.txt
fi
- name: Create Pull Request For Boost Version
uses: peter-evans/create-pull-request@v3
with:
commit-message: Upgrade Boost Version in CMake script.
title: Upgrade Boost Version in CMake script.
body: |
Updates [boostorg/boost](https://github.com/boostorg/boost) in CMake script.
Auto-generated by [create-pull-request](https://github.com/peter-evans/create-pull-request).
labels: update dependencies, automated PR
branch: boost-version-updates