Skip to content

Commit

Permalink
rewrite becasue wrong bazel link
Browse files Browse the repository at this point in the history
  • Loading branch information
bruhhgnik committed Oct 2, 2024
1 parent ba7e84e commit e9b11be
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 33 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/release-fedora.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
build:
runs-on: ubuntu-latest # Using Ubuntu, but we'll simulate Fedora with Docker
runs-on: ubuntu-latest # Using Ubuntu as the host runner, simulating Fedora with Docker

steps:
- name: Checkout stone-prover repository
Expand All @@ -20,11 +20,10 @@ jobs:
- name: Install dependencies inside Fedora container
run: |
docker exec -i fedora-build bash -c "dnf update -y && dnf install -y rpm-build gcc make python3-pip"
docker exec -i fedora-build bash -c "dnf update -y && dnf install -y rpm-build gcc make python3-pip wget git"
- name: Install Bazelisk in Fedora container
run: |
docker exec -i fedora-build bash -c "dnf install -y wget git"
docker exec -i fedora-build bash -c "wget https://github.com/bazelbuild/bazelisk/releases/download/v1.20.0/bazelisk-linux-amd64"
docker exec -i fedora-build bash -c "chmod +x bazelisk-linux-amd64 && mv bazelisk-linux-amd64 /usr/local/bin/bazelisk"
Expand All @@ -37,12 +36,12 @@ jobs:
docker exec -i fedora-build bash -c "chmod +x /build.sh && /build.sh" # Run build.sh inside container
- name: Copy stone-prover.spec into Fedora container
run: docker cp ./stone-prover.spec fedora-build:/stone-prover.spec # Copy the .spec file to the Fedora container
run: docker cp ./stone-prover.spec fedora-build:/stone-prover.spec # Copy .spec file into the container

- name: Package RPM inside Fedora container
run: |
docker exec -i fedora-build bash -c "mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}"
docker exec -i fedora-build bash -c "mv /stone-prover.spec ~/rpmbuild/SPECS/stone-prover.spec"
docker exec -i fedora-build bash -c "cp /stone-prover.spec ~/rpmbuild/SPECS/stone-prover.spec"
docker exec -i fedora-build bash -c "rpmbuild -ba ~/rpmbuild/SPECS/stone-prover.spec --define '_topdir $HOME/rpmbuild'"
- name: Verify RPM creation
Expand Down
43 changes: 15 additions & 28 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,41 +7,28 @@ set -e
os=$(uname | tr '[:upper:]' '[:lower:]')
arch=$(uname -m | sed s/aarch64/arm64/ | sed s/x86_64/amd64/)

# Install dependencies based on the OS
if [ "$os" == "linux" ]; then
export DEBIAN_FRONTEND=noninteractive

# Check for Fedora or Debian-based Linux
if [ -f /etc/fedora-release ]; then
echo "Detected Fedora"
sudo dnf clean all
sudo dnf update -y
sudo dnf install -y clang gcc-c++ libstdc++-devel libcxx libcxx-devel ncurses-compat-libs elfutils-devel gmp-devel python3-devel wget git

else
echo "Detected Debian-based Linux"
sudo apt-get update -y
sudo apt-get install -y clang gcc g++ libtinfo5 libdw-dev libgmp3-dev python3-dev wget git
fi
# Fedora-specific installation
if [ "$os" == "linux" ] && [ -f /etc/fedora-release ]; then
echo "Detected Fedora"

# Clean and update Fedora packages
sudo dnf clean all
sudo dnf update -y

# Install dependencies
sudo dnf install -y clang gcc-c++ libstdc++-devel libcxx libcxx-devel \
ncurses-compat-libs elfutils-devel gmp-devel python3-devel wget git

# Install Python dependencies
pip install cpplint pytest numpy sympy==1.12.1 cairo-lang==0.12.0

# Install Bazelisk (Bazel wrapper)
wget "https://github.com/bazelbuild/bazelisk/releases/download/v1.20.0/bazelisk-$os-$arch"
chmod 755 "bazelisk-$os-$arch"
sudo mv "bazelisk-$os-$arch" /bin/bazelisk

elif [ "$os" == "darwin" ]; then
# macOS dependencies
echo "Detected macOS"
brew install gmp

# Install Python dependencies
python3 -m pip install cpplint pytest numpy sympy==1.12.1 cairo-lang==0.12.0 --break-system-packages
wget "https://github.com/bazelbuild/bazelisk/releases/download/v1.20.0/bazelisk-linux-amd64"
chmod 755 "bazelisk-linux-amd64"
sudo mv "bazelisk-linux-amd64" /bin/bazelisk

else
echo "$os/$arch is not supported"
echo "$os is either not Fedora or not supported."
exit 1
fi

Expand Down

0 comments on commit e9b11be

Please sign in to comment.