Release #4
Workflow file for this run
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: Release | |
permissions: | |
contents: write | |
on: | |
push: | |
tags: | |
- v[0-9]+.* | |
jobs: | |
build: | |
name: Build and release binaries | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
platform: [ubuntu-latest, macos-latest, windows-latest] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
target: ${{ matrix.platform == 'windows-latest' && 'x86_64-pc-windows-gnu' || 'x86_64-unknown-linux-gnu' || 'x86_64-apple-darwin' }} | |
- name: Install Gurobi on Linux | |
if: matrix.platform == 'ubuntu-latest' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y wget | |
wget https://packages.gurobi.com/11.0/gurobi11.0.3_linux64.tar.gz | |
tar xvf gurobi11.0.3_linux64.tar.gz | |
cd gurobi952/linux64 | |
export GUROBI_HOME=$(pwd) | |
export PATH=$GUROBI_HOME/bin:$PATH | |
export LD_LIBRARY_PATH=$GUROBI_HOME/lib:$LD_LIBRARY_PATH | |
- name: Install Gurobi on macOS | |
if: matrix.platform == 'macos-latest' | |
run: | | |
brew install --cask gurobi | |
export GUROBI_HOME=/Library/gurobi1103/mac64 | |
export PATH=$GUROBI_HOME/bin:$PATH | |
export DYLD_LIBRARY_PATH=$GUROBI_HOME/lib:$DYLD_LIBRARY_PATH | |
- name: Install Gurobi on Windows | |
if: matrix.platform == 'windows-latest' | |
run: | | |
choco install gurobi | |
setx PATH "C:\gurobi1103\win64\bin;%PATH%" | |
- name: Build binary | |
run: cargo build --release --package cli | |
upload-assets: | |
needs: build | |
strategy: | |
matrix: | |
include: | |
- target: x86_64-unknown-linux-gnu | |
os: ubuntu-latest | |
- target: x86_64-apple-darwin | |
os: macos-latest | |
- target: x86_64-pc-windows-msvc | |
os: windows-latest | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: taiki-e/upload-rust-binary-action@v1 | |
with: | |
bin: cli | |
target: ${{ matrix.target }} | |
tar: unix | |
zip: windows | |
token: ${{ secrets.GITHUB_TOKEN }} |