diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 5f165bd..1ccef30 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -17,13 +17,41 @@ jobs: strategy: fail-fast: false matrix: - platform: [macos-latest, ubuntu-20.04, windows-latest] + include: + - platform: macos-latest + os: macos + - platform: ubuntu-20.04 + os: linux + - platform: windows-latest + os: windows + - platform: ubuntu-20.04 + os: centos + container: centos:7 runs-on: ${{ matrix.platform }} + container: ${{ matrix.container }} + steps: - uses: actions/checkout@v4 + + # Install dependencies for CentOS 7 + - name: Install dependencies on CentOS 7 + if: matrix.os == 'centos' + run: | + yum update -y + yum install -y gcc make openssl-devel pkgconfig + curl https://sh.rustup.rs -sSf | sh -s -- -y + source $HOME/.cargo/env + rustup default stable + + # Build for CentOS 7 + - name: Build on CentOS 7 + if: matrix.os == 'centos' + run: cargo build --release + - name: Build run: cargo build --release + if: matrix.os != 'centos' # Set up the GitHub CLI - name: Install GitHub CLI @@ -59,7 +87,8 @@ jobs: id: prep run: | PLATFORM_TAG=$(echo ${{ matrix.platform }} | sed -e 's/-latest//' -e 's/ubuntu-20.04/linux-x86_64/' -e 's/macos/macos-x86_64/' -e 's/windows/windows-x86_64/') - echo "ASSET_NAME=ncbi-$PLATFORM_TAG$(if [ ${{ runner.os }} = 'Windows' ]; then echo '.exe'; fi)" >> $GITHUB_ENV + ASSET_NAME="ncbi-${PLATFORM_TAG}$(if [ ${{ matrix.os }} = 'windows' ]; then echo '.exe'; elif [ ${{ matrix.os }} = 'centos' ]; then echo '-centos7'; fi)" + echo "ASSET_NAME=$ASSET_NAME" >> $GITHUB_ENV shell: bash - name: Upload Release Asset