Skip to content

Make sure prebuilt binary archives include a root directory #53

Make sure prebuilt binary archives include a root directory

Make sure prebuilt binary archives include a root directory #53

Workflow file for this run

name: Build & upload binaries
on:
push:
branches:
- main
paths-ignore:
- '**/README.md'
workflow_dispatch:
env:
regression: 1
jobs:
build_macos:
name: macOS
runs-on: macos-12
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install Rust Toolchain
run: |
rustup update
rustup target install x86_64-apple-darwin
rustup target install aarch64-apple-darwin
- name: Build
run: |
cd ${{ github.workspace }}
./util/build_osx.sh . build
- name: Run Regression Suite
if: ${{ env.regression == 1 }}
run: |
${{ github.workspace }}/regression/run_regression.sh ${{ github.workspace }}/build/foldmason ${{ github.workspace }}/scratch
- name: Upload MacOS Universal
uses: actions/upload-artifact@v3
with:
name: foldmason-darwin-universal
path: ${{ github.workspace }}/build/foldmason
build_ubuntu:
name: Build Ubuntu
runs-on: ubuntu-22.04
timeout-minutes: 120
strategy:
fail-fast: false
matrix:
include:
- SIMD: AVX2
STATIC: 1
MPI: 0
BUILD_TYPE: RelWithDebInfo
- SIMD: SSE4_1
STATIC: 1
MPI: 0
BUILD_TYPE: RelWithDebInfo
- SIMD: SSE2
STATIC: 1
MPI: 0
BUILD_TYPE: RelWithDebInfo
- SIMD: AVX2_MPI
STATIC: 0
MPI: 1
BUILD_TYPE: RelWithDebInfo
- SIMD: AVX2
STATIC: 0
MPI: 0
BUILD_TYPE: ASan
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install G++
run: |
sudo apt-get update
sudo apt-get install -y g++-12 rustc cargo
- name: Install Dependencies
if: matrix.MPI == 1
run: |
sudo apt-get update
sudo apt-get -y install mpi-default-dev mpi-default-bin
- name: Build Foldmason
run: |
mkdir build
cd build
export CC=gcc-12
export CXX=g++-12
if [ "${{ matrix.STATIC }}" -eq "1" ]; then
cmake -DHAVE_SANITIZER=1 -DCMAKE_BUILD_TYPE=${{ matrix.BUILD_TYPE }} -DHAVE_TESTS=1 \
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_EXE_LINKER_FLAGS="-static -static-libgcc \
-static-libstdc++" -DCMAKE_FIND_LIBRARY_SUFFIXES=".a" \
-DENABLE_WERROR=1 -DHAVE_${{ matrix.SIMD }}=1 -DHAVE_MPI=${{ matrix.MPI }} ..
else
cmake -DHAVE_SANITIZER=1 -DCMAKE_BUILD_TYPE=${{ matrix.BUILD_TYPE }} -DHAVE_TESTS=1 \
-DENABLE_WERROR=1 -DHAVE_${{ matrix.SIMD }}=1 -DHAVE_MPI=${{ matrix.MPI }} ..
fi
make -j $(nproc --all)
- name: Run Regression Suite
if: ${{ env.regression == 1 }}
run: |
export TTY=0
${{ github.workspace }}/regression/run_regression.sh ${{ github.workspace }}/build/src/foldmason ${{ github.workspace }}/regression
- name: Upload Linux
if: matrix.STATIC == 1
uses: actions/upload-artifact@v3
with:
name: foldmason-linux-${{ matrix.SIMD }}
path: build/src/foldmason
build_ubuntu_cross:
name: Ubuntu Cross-Compile
runs-on: ubuntu-22.04
timeout-minutes: 120
strategy:
matrix:
include:
- SIMD: ARM8
ARCH: arm64
CPREF: aarch64
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install Toolchain
run: |
sudo dpkg --add-architecture ${{ matrix.ARCH }}
cat << HEREDOC | sudo tee /etc/apt/sources.list
deb [arch=amd64,i386] http://archive.ubuntu.com/ubuntu/ jammy main universe multiverse
deb [arch=amd64,i386] http://archive.ubuntu.com/ubuntu/ jammy-updates main universe multiverse
deb [arch=amd64,i386] http://archive.ubuntu.com/ubuntu/ jammy-backports main universe multiverse
deb [arch=amd64,i386] http://security.ubuntu.com/ubuntu/ jammy-security main universe multiverse
deb [arch=${{ matrix.ARCH }}] http://ports.ubuntu.com/ubuntu-ports/ jammy main universe multiverse
deb [arch=${{ matrix.ARCH }}] http://ports.ubuntu.com/ubuntu-ports/ jammy-updates main universe multiverse
deb [arch=${{ matrix.ARCH }}] http://ports.ubuntu.com/ubuntu-ports/ jammy-backports main universe multiverse
deb [arch=${{ matrix.ARCH }}] http://ports.ubuntu.com/ubuntu-ports/ jammy-security main universe multiverse
HEREDOC
sudo apt-get update
sudo apt-get -y install -o APT::Immediate-Configure=false crossbuild-essential-${{ matrix.ARCH }} zlib1g-dev:${{ matrix.ARCH }} libbz2-dev:${{ matrix.ARCH }} g++-12-${{ matrix.CPREF }}-linux-gnu
rustup target add ${{ matrix.CPREF }}-unknown-linux-gnu
- name: Build Cross
run: |
mkdir build && cd build
CC=${{ matrix.CPREF }}-linux-gnu-gcc-12 CXX=${{ matrix.CPREF }}-linux-gnu-g++-12 \
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHAVE_TESTS=1 \
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_EXE_LINKER_FLAGS="-static -static-libgcc -static-libstdc++" \
-DCMAKE_FIND_LIBRARY_SUFFIXES=".a" \
-DRust_CARGO_TARGET=${{ matrix.CPREF }}-unknown-linux-gnu \
-DENABLE_WERROR=1 -DHAVE_${{ matrix.SIMD }}=1 ..
make -j $(nproc --all)
- name: Upload Linux Artifact
uses: actions/upload-artifact@v3
with:
name: foldmason-linux-${{ matrix.SIMD }}
path: build/src/foldmason
upload_artifacts:
name: Upload Artifacts
runs-on: ubuntu-latest
needs: [build_macos, build_ubuntu, build_ubuntu_cross]
if: github.event_name != 'pull_request'
steps:
- uses: actions/checkout@v4
- name: Prepare Artifacts Directory
run: |
mkdir foldmason
cp -f README.md LICENSE.md foldmason
mkdir foldmason/bin
# MacOS
- name: Download foldmason-darwin-universal Artifact
uses: actions/download-artifact@v3
with:
name: foldmason-darwin-universal
path: foldmason/bin
- name: Archive Mac Binary
run: |
chmod +x foldmason/bin/foldmason
tar -czvf foldmason-osx-universal.tar.gz foldmason
# Linux SSE41
- name: Download foldmason-linux-SSE4_1 Artifact
uses: actions/download-artifact@v3
with:
name: foldmason-linux-SSE4_1
path: foldmason/bin
- name: Archive SSE4_1 Binary
run: |
chmod +x foldmason/bin/foldmason
tar -czvf foldmason-linux-sse41.tar.gz foldmason
# Linux SSE2
- name: Download foldmason-linux-SSE2 Artifact
uses: actions/download-artifact@v3
with:
name: foldmason-linux-SSE2
path: foldmason/bin
- name: Archive SSE2 Binary
run: |
chmod +x foldmason/bin/foldmason
tar -czvf foldmason-linux-sse2.tar.gz foldmason
# Linux AVX2
- name: Download foldmason-linux-AVX2 Artifact
uses: actions/download-artifact@v3
with:
name: foldmason-linux-AVX2
path: foldmason/bin
- name: Archive AVX2 Binary
run: |
chmod +x foldmason/bin/foldmason
tar -czvf foldmason-linux-avx2.tar.gz foldmason
# Linux ARM64
- name: Download foldmason-linux-ARM8 Artifact
uses: actions/download-artifact@v3
with:
name: foldmason-linux-ARM8
path: foldmason/bin
- name: Archive ARM8 Binary
run: |
chmod +x foldmason/bin/foldmason
tar -czvf foldmason-linux-arm64.tar.gz foldmason
- name: Get Deployment Key
run: |
mkdir -p $HOME/.ssh
echo "$PRIVATE_KEY" > $HOME/.ssh/id_rsa
chmod 700 $HOME/.ssh && chmod 600 $HOME/.ssh/id_rsa
ssh-keygen -f $HOME/.ssh/id_rsa -y > $HOME/.ssh/id_rsa.pub
env:
PRIVATE_KEY : ${{ secrets.PRIVATE_KEY }}
- name: Sign and Upload Artifacts
run: |
ssh-keygen -Y sign -f $HOME/.ssh/id_rsa -n file foldmason-osx-universal.tar.gz foldmason-linux-sse2.tar.gz foldmason-linux-sse41.tar.gz foldmason-linux-avx2.tar.gz foldmason-linux-arm64.tar.gz
curl --retry 5 --retry-all-errors -X POST \
-F file[][email protected] -F signature[][email protected] \
-F file[][email protected] -F signature[][email protected] \
-F file[][email protected] -F signature[][email protected] \
-F file[][email protected] -F signature[][email protected] \
-F file[][email protected] -F signature[][email protected] \
-F identifier="foldmason" -F directory="${{ github.sha }}" \
https://mmseqs.com/upload