CI: Fix relative paths and add macos arm upload job #2
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: Build and Package for macOS ARM | |
on: | |
push: | |
branches: | |
- m1-precompiled-package | |
jobs: | |
build: | |
runs-on: macos-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Install Homebrew | |
run: | | |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" | |
if: success() # Install Homebrew only if the previous step succeeds | |
- name: Install required dependencies | |
run: | | |
brew install cmake curl | |
if: success() # Install dependencies only if the previous step succeeds | |
- name: Set up ARM64 toolchain | |
run: | | |
export HOMEBREW_ARCH=arm64 | |
export PATH="/opt/homebrew/bin:$PATH" | |
if: success() # Set up the ARM64 toolchain only if the previous step succeeds | |
- name: Build soplex | |
run: | | |
curl -L https://github.com/scipopt/soplex/archive/refs/tags/release-604.tar.gz | tar xz | |
cd soplex-release-604 | |
mkdir build | |
cd build | |
cmake -DCMAKE_INSTALL_PREFIX=~/scip .. | |
make -j | |
make install | |
if: success() # Build soplex only if the previous steps succeed | |
- name: Build C++ program | |
run: | | |
mkdir build | |
cd build | |
cmake .. -DSOPLEX_DIR=~/scip -DAUTOBUILD=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=~/scip | |
make -j | |
make install | |
if: success() # Build the program only if the previous steps succeed | |
- name: Package the program | |
run: | | |
zip -r ~/package.zip ~/scip | |
if: success() # Package the program only if the previous steps succeed | |
- name: Upload package artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: scip_macos_arm # Replace with your desired artifact name | |
path: ~/package.zip # Replace with the actual path to your packaged program |