From 1bf2f0647954e410d25152f25aa455e9b97fe1f9 Mon Sep 17 00:00:00 2001 From: Stephen G Tuggy Date: Fri, 10 Jan 2025 15:16:04 -0800 Subject: [PATCH] bootstrap-mac.sh, bootstrap-on-macOS-using-MacPorts.sh: Update the bootstrapping scripts. Also update macos-ci.yml, and add macos-release.yml --- .github/workflows/macos-ci.yml | 33 ++++- .github/workflows/macos-release.yml | 137 ++++++++++++++++++++ script/bootstrap-mac.sh | 6 +- script/bootstrap-on-macOS-using-MacPorts.sh | 5 +- 4 files changed, 172 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/macos-release.yml diff --git a/.github/workflows/macos-ci.yml b/.github/workflows/macos-ci.yml index 122320b65a..d47e8032a8 100644 --- a/.github/workflows/macos-ci.yml +++ b/.github/workflows/macos-ci.yml @@ -25,16 +25,34 @@ jobs: - macos-13 # M1 processor #- macos-14 + python-version: + #- 3.12.8 + - 3.13.1 compiler: - - clang - - gcc + - AppleClang + #- clang + #- gcc + homebrew-gl: + - true + #- false + homebrew-al: + - true + #- false + ENABLE_PIE: + - 'ON' + #- 'OFF' steps: # specific setup for Python on Mac to ensure Python Version align - name: Python Setup on Mac uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 + id: vega-py-setup with: - python-version: 3.12.8 + python-version: ${{ matrix.python-version }} + update-environment: true # false + + - name: Install dependencies using homebrew + run: brew install boost-python3 gtk+3 gtkglext sdl libvorbis # The following dependencies are already present within macos-* images: # MacOS has a Developers Tools package from Apple that gets installed which @@ -64,8 +82,13 @@ jobs: env: MY_OS_NAME: macos COMPILER: ${{ matrix.compiler }} - FLAGS: -DCMAKE_FIND_FRAMEWORK=LAST + FLAGS: "-DCMAKE_FIND_FRAMEWORK=LAST -DENABLE_PIE=${{ matrix.ENABLE_PIE }} -DPython3_ROOT_DIR=${{ matrix.vega-py-setup.outputs.python-path }}" OPENALDIR: "/usr/local/opt/openal-soft" + Python3_ROOT_DIR: ${{ matrix.vega-py-setup.outputs.python-path }} + Python_ROOT_DIR: ${{ matrix.vega-py-setup.outputs.python-path }} + pythonLocation: ${{ matrix.vega-py-setup.outputs.python-path }} + PYTHONHOME: "" + PYTHONPATH: "" run: script/cibuild $FLAGS - name: Test @@ -76,7 +99,7 @@ jobs: run: ctest -V - name: Upload test results - uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 #v3.1.3 + uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 #v4.3.3 if: failure() with: name: test_results_xml diff --git a/.github/workflows/macos-release.yml b/.github/workflows/macos-release.yml new file mode 100644 index 0000000000..6686d3cbb9 --- /dev/null +++ b/.github/workflows/macos-release.yml @@ -0,0 +1,137 @@ +name: 'MacOS-Release' + +on: + release: + types: + - created + - edited + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + build: + name: Build + runs-on: ${{ matrix.os }} + + defaults: + run: + shell: bash + + strategy: + fail-fast: false + matrix: + os: + # x86-64 + - macos-13 + # M1 processor + #- macos-14 + python-version: + #- 3.12.8 + - 3.13.1 + compiler: + - AppleClang + #- clang + #- gcc + homebrew-gl: + - true + #- false + homebrew-al: + - true + #- false + ENABLE_PIE: + - 'ON' + #- 'OFF' + + steps: + + # The following dependencies are already present within macos-* images: + # - clang (llvm) + # - cmake + # - expat + # - gcc + # - git + # - jpeg + # - libpng + # - ~libvorbis~ + # - python + # specific setup for Python on Mac to ensure Python Version align + - name: Python Setup on Mac + uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 + id: vega-py-setup + with: + python-version: ${{ matrix.python-version }} + update-environment: true # false + + - name: Install dependencies using homebrew + run: brew install boost-python3 gtk+3 gtkglext sdl libvorbis + + # The following Apple-provided libraries are deprecated: + # * OpenGL as of macOS 10.14 + # * GLUT as of macOS 10.9 + - name: Optionally install homebrewed OpenGL and GLUT + if: ${{ matrix.homebrew-gl }} + run: | + brew install mesa mesa-glu freeglut + ln -s "$(brew --prefix)/include/GL" "$(brew --prefix)/include/OpenGL" + ln -s "$(brew --prefix)/include/GL" "$(brew --prefix)/include/GLUT" + + # The Apple-provided OpenAL is deprecated as of macOS 10.15 + - name: Optionally install homebrewed OpenAL + if: ${{ matrix.homebrew-al }} + run: brew install openal-soft + + - name: Check out repository + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + fetch-depth: 2 + submodules: false + + - name: Extract tag name and short SHA + shell: bash + run: | + echo "TAG_NAME=$(echo ${GITHUB_REF#refs/tags/} | sed 's/\//_/g')" >> $GITHUB_ENV + echo "SHORT_SHA=`git rev-parse --short HEAD`" >> $GITHUB_ENV + - name: Test tag name and short SHA + run: | + echo "${TAG_NAME}" + echo "${SHORT_SHA}" + + - name: Build it + env: + MY_OS_NAME: macos + COMPILER: ${{ matrix.compiler }} + FLAGS: "-DCMAKE_FIND_FRAMEWORK=LAST -DENABLE_PIE=${{ matrix.ENABLE_PIE }} -DPython3_ROOT_DIR=${{ matrix.vega-py-setup.outputs.python-path }}" + OPENALDIR: "$(brew --prefix)/opt/openal-soft" + Python3_ROOT_DIR: ${{ matrix.vega-py-setup.outputs.python-path }} + Python_ROOT_DIR: ${{ matrix.vega-py-setup.outputs.python-path }} + pythonLocation: ${{ matrix.vega-py-setup.outputs.python-path }} + PYTHONHOME: "" + PYTHONPATH: "" + IS_RELEASE: 1 + run: script/cibuild $FLAGS + + - name: Test + working-directory: ${{github.workspace}}/build + env: + GTEST_OUTPUT: xml + GTEST_COLOR: 1 + run: ctest -V + + - name: Upload test results + uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 #v4.3.3 + if: failure() + with: + name: test_results_xml + path: ${{github.workspace}}/build/test-results/**/*.xml + + - name: Package it + working-directory: ${{github.workspace}}/build + run: cpack -V + + - name: Upload the artifacts + uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191 # v2.0.8 + if: startsWith(github.ref, 'refs/tags/') + with: + token: ${{ secrets.GITHUB_TOKEN }} + files: "packages/*.*" diff --git a/script/bootstrap-mac.sh b/script/bootstrap-mac.sh index 2178488764..436a612417 100755 --- a/script/bootstrap-mac.sh +++ b/script/bootstrap-mac.sh @@ -67,8 +67,10 @@ brew install \ # * OpenGL as of macOS 10.14 # * GLUT as of macOS 10.9 brew install mesa mesa-glu freeglut -ln -s $(brew --prefix)/include/GL $(brew --prefix)/include/OpenGL -ln -s $(brew --prefix)/include/GL $(brew --prefix)/include/GLUT + +# Keep these lines! Otherwise you will likely get PFNGL... not found errors. +ln -s "$(brew --prefix)/include/GL" "$(brew --prefix)/include/OpenGL" +ln -s "$(brew --prefix)/include/GL" "$(brew --prefix)/include/GLUT" # MacOS 13+ needs Vorbis support brew install vorbis-tools diff --git a/script/bootstrap-on-macOS-using-MacPorts.sh b/script/bootstrap-on-macOS-using-MacPorts.sh index 7f1c393c69..eb84177e0e 100755 --- a/script/bootstrap-on-macOS-using-MacPorts.sh +++ b/script/bootstrap-on-macOS-using-MacPorts.sh @@ -32,5 +32,6 @@ export CMAKE_PREFIX_PATH="/opt/local/" echo "CMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH" -ln -s $CMAKE_PREFIX_PATH/include/GL $CMAKE_PREFIX_PATH/include/OpenGL -ln -s $CMAKE_PREFIX_PATH/include/GL $CMAKE_PREFIX_PATH/include/GLUT +# Keep these lines! Otherwise you will likely get PFNGL... not found errors. +ln -s "$CMAKE_PREFIX_PATH/include/GL" "$CMAKE_PREFIX_PATH/include/OpenGL" +ln -s "$CMAKE_PREFIX_PATH/include/GL" "$CMAKE_PREFIX_PATH/include/GLUT"