MarkusJx / install-boost

Install boost on Github actions
MIT License
62 stars 3 forks source link

Header Only installation. #41

Open weinbe58 opened 9 months ago

weinbe58 commented 9 months ago

Hello! I like this action; it will be super helpful for my project; however, my project only needs the header files from Boost to work, and for some reason, my current build workflow doesn't like the extra binary files generated by this action.

I can probably remove the extra binary files in my action, but having a header-only installation would be great!

Thanks!

MarkusJx commented 8 months ago

The easiest way to achieve this would probably be by simply downloading and extracting the binary:

name: Build

on:
  push:
  pull_request:

env:
  BOOST_VERSION: 1.84.0
  # The version with underscores instead of dots, you could also use a bash script for this
  BOOST_DIR_VER_NAME: 1_84_0

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v3
      # Use a cache for increased performance
      - name: Cache Boost
        id: cache-boost
        uses: actions/cache@v3
        with:
          path: include/boost
          key: ${{ runner.os }}-boost
      - name: Download boost
        if: steps.cache-boost.outputs.cache-hit != 'true'
        run: |
          wget https://boostorg.jfrog.io/artifactory/main/release/${{env.BOOST_VERSION}}/source/boost_${{env.BOOST_DIR_VER_NAME}}.tar.gz
          tar xzf boost_${{env.BOOST_DIR_VER_NAME}}.tar.gz
          mkdir include
          mv boost_${{env.BOOST_DIR_VER_NAME}}/boost include/boost
          rm -rf boost_${{env.BOOST_DIR_VER_NAME}} boost_${{env.BOOST_DIR_VER_NAME}}.tar.gz

Although I have not tested this, it should work just fine (maybe the environment variables are not used correctly, but I'm confident you'll figure it out). Anyways, I hope this fits your needs as this actions focus is on prebuilt boost binaries and not just downloading and unzipping the tarballs. If this doesn't help, let me know and I'll see if i can include a non-prebuilt option in this action.