Skip to content

Build Boost

Build Boost #119

Workflow file for this run

name: Build Boost
on:
workflow_dispatch:
inputs:
version:
description: 'Boost version to build'
required: true
release:
description: 'Release'
type: boolean
required: false
default: true
delete-previous:
description: 'Delete previous release'
type: boolean
required: false
default: true
jobs:
build:
strategy:
matrix:
include:
# Ubuntu
- os: ubuntu-20.04
COMPILER: gcc
LINK: 'static+shared'
ARCH: x86
- os: ubuntu-20.04
COMPILER: gcc
LINK: 'static+shared'
ARCH: aarch64
- os: ubuntu-22.04
COMPILER: gcc
LINK: 'static+shared'
ARCH: x86
# Windows Server 2019
- os: windows-2019
COMPILER: msvc
LINK: 'static'
ARCH: x86
- os: windows-2019
COMPILER: msvc
LINK: 'shared'
ARCH: x86
- os: windows-2019
COMPILER: mingw
LINK: 'static'
ARCH: x86
#- os: windows-2019
# COMPILER: mingw
# LINK: 'shared'
# ARCH: x86
# Windows Server 2022
- os: windows-2022
COMPILER: msvc
LINK: 'static'
ARCH: x86
- os: windows-2022
COMPILER: msvc
LINK: 'shared'
ARCH: x86
- os: windows-2022
COMPILER: mingw
LINK: 'static'
ARCH: x86
#- os: windows-2022
# COMPILER: mingw
# LINK: 'shared'
# ARCH: x86
# MacOs
- os: macos-11
COMPILER: clang
LINK: 'static+shared'
ARCH: x86
- os: macos-12
COMPILER: clang
LINK: 'static+shared'
ARCH: x86
- os: macos-13
COMPILER: clang
LINK: 'static+shared'
ARCH: x86
- os: macos-14
COMPILER: clang
LINK: 'static+shared'
ARCH: aarch64
runs-on: ${{matrix.os}}
steps:
- name: git clone
run: git clone https://github.com/boostorg/boost
- name: git checkout
run: git checkout tags/boost-${{github.event.inputs.version}}
working-directory: boost
- name: git submodule init
run: git submodule update --init --recursive
working-directory: boost
- name: Delete .git windows
run: RD /S /Q .git
if: runner.os == 'Windows'
shell: cmd
working-directory: boost
- name: Delete .git unix
run: rm -rf .git
if: runner.os != 'Windows'
working-directory: boost
# Setup cl.exe (windows only)
- name: Setup VS Dev Environment
uses: compnerd/gha-setup-vsdevenv@v6
if: ${{ runner.os == 'Windows' && matrix.COMPILER == 'msvc' }}
# Setup MinGW (windows only)
#- name: Setup MinGW
# uses: egor-tensin/setup-mingw@v2
# if: ${{ runner.os == 'Windows' && matrix.COMPILER == 'mingw' }}
# Install ARM Toolchain on ubuntu
- name: Install ARM Toolchain
if: ${{ runner.os == 'Linux' && matrix.ARCH == 'aarch64' }}
run: |
sudo apt-get update
sudo apt-get install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu -y
# Install python
- name: Setup python 3.7
uses: actions/setup-python@v5
if: ${{ (runner.os != 'Windows' || matrix.COMPILER != 'msvc' || matrix.LINK != 'shared') && matrix.os != 'macos-14' }}
with:
python-version: '3.7'
- name: Add python 3.7 to user-config
working-directory: boost/tools/build/src
if: ${{ (runner.os != 'Windows' || matrix.COMPILER != 'msvc' || matrix.LINK != 'shared') && matrix.os != 'macos-14' }}
shell: bash
run: |
VAR="using python : 3.7 : $Python_ROOT_DIR ;"
echo ${VAR//\\/\/} >> user-config.jam
- name: Setup python 3.8
uses: actions/setup-python@v5
if: ${{ (runner.os != 'Windows' || matrix.COMPILER != 'msvc' || matrix.LINK != 'shared') && matrix.os != 'macos-14' }}
with:
python-version: '3.8'
- name: Add python 3.8 to user-config
working-directory: boost/tools/build/src
if: ${{ (runner.os != 'Windows' || matrix.COMPILER != 'msvc' || matrix.LINK != 'shared') && matrix.os != 'macos-14' }}
shell: bash
run: |
VAR="using python : 3.8 : $Python_ROOT_DIR ;"
echo ${VAR//\\/\/} >> user-config.jam
- name: Setup python 3.9
uses: actions/setup-python@v5
if: ${{ (runner.os != 'Windows' || matrix.COMPILER != 'msvc' || matrix.LINK != 'shared') && matrix.os != 'macos-14' }}
with:
python-version: '3.9'
- name: Add python 3.9 to user-config
working-directory: boost/tools/build/src
if: ${{ (runner.os != 'Windows' || matrix.COMPILER != 'msvc' || matrix.LINK != 'shared') && matrix.os != 'macos-14' }}
shell: bash
run: |
VAR="using python : 3.9 : $Python_ROOT_DIR ;"
echo ${VAR//\\/\/} >> user-config.jam
- name: Setup python 3.10
uses: actions/setup-python@v5
if: ${{ (runner.os != 'Windows' || matrix.COMPILER != 'msvc' || matrix.LINK != 'shared') && matrix.os != 'macos-14' }}
with:
python-version: '3.10'
- name: Add python 3.10 to user-config
working-directory: boost/tools/build/src
if: ${{ (runner.os != 'Windows' || matrix.COMPILER != 'msvc' || matrix.LINK != 'shared') && matrix.os != 'macos-14' }}
shell: bash
run: |
VAR="using python : 3.10 : $Python_ROOT_DIR ;"
echo ${VAR//\\/\/} >> user-config.jam
- name: Setup python 3.11
uses: actions/setup-python@v5
if: ${{ runner.os != 'Windows' || matrix.COMPILER != 'msvc' || matrix.LINK != 'shared' }}
with:
python-version: '3.11'
- name: Add python 3.11 to user-config
working-directory: boost/tools/build/src
if: ${{ runner.os != 'Windows' || matrix.COMPILER != 'msvc' || matrix.LINK != 'shared' }}
shell: bash
run: |
VAR="using python : 3.11 : $Python_ROOT_DIR ;"
echo ${VAR//\\/\/} >> user-config.jam
- name: Setup python 3.12
uses: actions/setup-python@v5
if: ${{ runner.os != 'Windows' || matrix.COMPILER != 'msvc' || matrix.LINK != 'shared' }}
with:
python-version: '3.12'
- name: Add python 3.12 to user-config
working-directory: boost/tools/build/src
if: ${{ runner.os != 'Windows' || matrix.COMPILER != 'msvc' || matrix.LINK != 'shared' }}
shell: bash
run: |
VAR="using python : 3.12 : $Python_ROOT_DIR ;"
echo ${VAR//\\/\/} >> user-config.jam
# Build steps
- name: Bootstrap windows
if: ${{ runner.os == 'Windows' && matrix.COMPILER == 'msvc' }}
run: .\bootstrap.bat msvc
working-directory: boost
- name: Bootstrap windows MinGW
if: ${{ runner.os == 'Windows' && matrix.COMPILER == 'mingw' }}
run: .\bootstrap.bat mingw
working-directory: boost
- name: Bootstrap unix
if: runner.os != 'Windows'
run: ./bootstrap.sh
working-directory: boost
- name: Build windows msvc (static)
if: ${{ runner.os == 'Windows' && matrix.COMPILER == 'msvc' && matrix.LINK == 'static' }}
#run: .\b2.exe install --build-dir='tmp' --prefix='.' runtime-link='static,shared' link='static,shared' variant='release,debug' address-model='32,64' -j4 msvc stage
run: .\b2.exe install --build-dir='tmp' --prefix='.' variant='release,debug' address-model='32,64' link=${{matrix.LINK}} python='3.7,3.8,3.9,3.10,3.11,3.12' -j4 msvc stage
working-directory: boost
- name: Build windows msvc (shared) without python
if: ${{ runner.os == 'Windows' && matrix.COMPILER == 'msvc' && matrix.LINK == 'shared' }}
run: .\b2.exe install --build-dir='tmp' --prefix='.' --without-python variant='release,debug' address-model='32,64' link=${{matrix.LINK}} -j4 msvc stage
working-directory: boost
- name: Build windows mingw
if: ${{ runner.os == 'Windows' && matrix.COMPILER == 'mingw' }}
run: .\b2.exe install --build-dir='tmp' --prefix='.' variant='release,debug' runtime-link='static,shared' address-model='32,64' --hash -j4 toolset=gcc stage
working-directory: boost
- name: Build debug unix x86
if: ${{ runner.os != 'Windows' && matrix.ARCH == 'x86' }}
run: ./b2 install --build-dir='tmp' --prefix='.' --layout='tagged' link='static,shared' runtime-link='static,shared' variant='debug' python='3.7,3.8,3.9,3.10,3.11,3.12' -j2
working-directory: boost
- name: Build release unix x86
if: ${{ runner.os != 'Windows' && matrix.ARCH == 'x86' }}
run: ./b2 install --build-dir='tmp' --prefix='.' --layout='tagged' link='static,shared' runtime-link='static,shared' variant='release' python='3.7,3.8,3.9,3.10,3.11,3.12' -j2
working-directory: boost
- name: Build debug macos arm64
if: ${{ runner.os == 'macOS' && matrix.ARCH == 'aarch64' }}
run: ./b2 install --build-dir='tmp' --prefix='.' --layout='tagged' link='static,shared' runtime-link='static,shared' variant='debug' python='3.11,3.12' -j2
working-directory: boost
- name: Build release macos arm64
if: ${{ runner.os == 'macOS' && matrix.ARCH == 'aarch64' }}
run: ./b2 install --build-dir='tmp' --prefix='.' --layout='tagged' link='static,shared' runtime-link='static,shared' variant='release' python='3.11,3.12' -j2
working-directory: boost
- name: Build debug ubuntu arm
if: ${{ runner.os == 'Linux' && matrix.ARCH == 'aarch64' }}
run: |
echo "using gcc : aarch64 : aarch64-linux-gnu-g++ ;" > user-config.jam
./b2 install --build-dir='tmp' --prefix='.' --layout='tagged' link='static,shared' runtime-link='static,shared' variant='debug' \
toolset='gcc-aarch64' --without-python address-model=64 --user-config=./user-config.jam -j2
working-directory: boost
- name: Build release ubuntu arm
if: ${{ runner.os == 'Linux' && matrix.ARCH == 'aarch64' }}
run: |
echo "using gcc : aarch64 : aarch64-linux-gnu-g++ ;" > user-config.jam
./b2 install --build-dir='tmp' --prefix='.' --layout='tagged' link='static,shared' runtime-link='static,shared' variant='release' \
toolset='gcc-aarch64' --without-python address-model=64 --user-config=./user-config.jam -j2
working-directory: boost
- name: Copy include directories
if: ${{ runner.os == 'Windows' }}
working-directory: boost
shell: bash
run: cp -r include/boost-*/boost include/boost
# Upload steps
- name: Cleanup windows
run: RD /S /Q tmp
if: runner.os == 'Windows'
shell: cmd
working-directory: boost
- name: Cleanup unix
run: rm -rf tmp
if: runner.os != 'Windows'
working-directory: boost
- name: Compress files
run: tar -czf boost-${{github.event.inputs.version}}-${{matrix.os}}-${{matrix.COMPILER}}-${{matrix.LINK}}-${{matrix.ARCH}}.tar.gz boost
- name: Upload boost artifact
uses: actions/upload-artifact@v4
with:
retention-days: 1
name: boost-${{matrix.os}}-${{matrix.COMPILER}}-${{matrix.LINK}}-${{matrix.ARCH}}
path: "boost-*.tar.gz"
upload:
runs-on: ubuntu-latest
needs: [build]
if: github.event.inputs.release == 'true'
#if: github.ref_name == 'main'
steps:
- name: Delete previous release
uses: dev-drprasad/[email protected]
if: github.event.inputs.delete-previous == 'true'
with:
tag_name: ${{github.event.inputs.version}}
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Download all Artifacts
uses: actions/download-artifact@v4
- name: Move artifacts
shell: bash
run: |
mv */* .
find . -type d -empty -delete
- name: Create Release
uses: ncipollo/release-action@v1
with:
draft: false
tag: ${{github.event.inputs.version}}
artifacts: "boost-*"
token: ${{ secrets.GITHUB_TOKEN }}
update-manifest:
runs-on: ubuntu-latest
needs: [upload]
if: github.event.inputs.release == 'true'
steps:
- uses: actions/checkout@v4
- name: Set up node
uses: actions/setup-node@v4
- name: Install dependencies
run: npm ci
working-directory: manifest-creator
- name: Update manifest
run: npm start
working-directory: manifest-creator
- name: Commit manifest
uses: EndBug/add-and-commit@v9
with:
add: versions-manifest.json
message: 'chore: update versions-manifest'