-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #65 from bruhhgnik/native_package_fedora
Feat/Native package fedora
- Loading branch information
Showing
4 changed files
with
139 additions
and
2 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Release Stone Prover for Fedora | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*.*.*' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: fedora:38 | ||
options: --workdir /github/workspace | ||
env: | ||
TARGET_ARCH: x86_64 | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up environment and build | ||
run: | | ||
chmod +x ./fedora-build.sh | ||
./fedora-build.sh | ||
- name: Test | ||
run: | | ||
chmod +x ./test.sh | ||
./test.sh | ||
- name: Set version output | ||
id: vars | ||
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT | ||
|
||
- name: Package RPM | ||
run: | | ||
chmod +x ./package_rpm.sh | ||
./package_rpm.sh ${{ steps.vars.outputs.tag }} | ||
- name: Rename RPM package | ||
run: | | ||
mv /tmp/stone-prover/*.rpm /github/workspace/stone-prover-fedora-${TARGET_ARCH}.rpm | ||
- name: Upload files to GitHub release | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
files: | | ||
/github/workspace/*.rpm | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/bin/bash | ||
# Build script for Fedora | ||
set -o xtrace | ||
set -e | ||
os=$(uname | tr '[:upper:]' '[:lower:]') | ||
arch=$(uname -m | sed s/aarch64/arm64/ | sed s/x86_64/amd64/) | ||
|
||
|
||
# Update and install system dependencies | ||
dnf update -y && dnf install -y \ | ||
git \ | ||
gcc gcc-c++ make wget openssl-devel bzip2-devel libffi-devel \ | ||
elfutils-libelf-devel gmp-devel elfutils-devel clang \ | ||
libstdc++-devel libcxx libcxx-devel ncurses-compat-libs cairo-devel \ | ||
zlib-devel ncurses-devel sqlite-devel \ | ||
rpm-build \ | ||
readline-devel tk-devel gdbm-devel xz-devel \ | ||
|
||
# Install Python 3.9 from source | ||
wget https://www.python.org/ftp/python/3.9.17/Python-3.9.17.tgz \ | ||
&& tar xzf Python-3.9.17.tgz \ | ||
&& cd Python-3.9.17 \ | ||
&& ./configure --enable-optimizations \ | ||
&& make altinstall \ | ||
&& cd .. && rm -rf Python-3.9.17* | ||
|
||
# Install Python packages | ||
pip3.9 install cpplint pytest numpy sympy==1.12.1 cairo-lang==0.12.0 | ||
|
||
# Install Bazelisk | ||
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 | ||
|
||
git clone https://github.com/baking-bad/stone-prover.git /tmp/stone-prover | ||
|
||
cd /tmp/stone-prover || exit | ||
|
||
bazelisk build --cpu=$arch //... | ||
|
||
bazelisk test --cpu=$arch //... | ||
|
||
# Create symbolic links for cpu_air_prover and cpu_air_verifier | ||
ln -s /tmp/stone-prover/build/bazelbin/src/starkware/main/cpu/cpu_air_prover /usr/local/bin/cpu_air_prover | ||
ln -s /tmp/stone-prover/build/bazelbin/src/starkware/main/cpu/cpu_air_verifier /usr/local/bin/cpu_air_verifier | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# Install dependencies | ||
sudo dnf install -y ruby ruby-devel rubygems gcc make rpm-build | ||
|
||
# Install fpm | ||
sudo gem install --no-document fpm | ||
|
||
# Create a temporary directory for the package | ||
|
||
mkdir -p /tmp/stone-prover/usr/bin | ||
|
||
TAG=$1 | ||
|
||
# Copy binaries into the package directory | ||
cp /usr/local/bin/cpu_air_prover /tmp/stone-prover/usr/bin/ | ||
cp /usr/local/bin/cpu_air_verifier /tmp/stone-prover/usr/bin/ | ||
|
||
# Build the RPM package using fpm | ||
fpm -s dir -t rpm \ | ||
-n stone-prover \ | ||
-v "$(echo $TAG | cut -c 2-)" \ | ||
-a "$(uname -m)" \ | ||
-C /tmp/stone-prover/ \ | ||
--prefix / \ | ||
--maintainer "Baking Bad <[email protected]>" \ | ||
--description "Stone prover RPM package" \ | ||
-p /tmp/stone-prover/stone-prover.rpm |