diff --git a/.github/workflows/linux-release.yml b/.github/workflows/linux-release.yml deleted file mode 100644 index c019e2a7..00000000 --- a/.github/workflows/linux-release.yml +++ /dev/null @@ -1,60 +0,0 @@ -name: Linux release - -on: - push: - tags: - - 'v*.*.*' - -jobs: - build: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-22.04] - arch: [x64, arm64] - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Set up environment - run: | - echo "Setting up environment for ${{ matrix.arch }}" - if [ "${{ matrix.arch }}" == "x64" ]; then - echo "TARGET_ARCH=x86_64" >> $GITHUB_ENV - elif [ "${{ matrix.arch }}" == "arm64" ]; then - echo "TARGET_ARCH=arm64" >> $GITHUB_ENV - fi - - - name: Build and Test - run: | - chmod +x ./build_and_test.sh - ./build_and_test.sh - - - name: Set output - id: vars - run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT - - - name: Extract files and build DEB package - run: | - chmod +x ./build_deb.sh - ./build_deb.sh ${{ steps.vars.outputs.tag }} - - - name: Rename binaries - run: | - echo "Renaming binaries to include architecture" - mv /tmp/stone-prover/build/bazelbin/src/starkware/main/cpu/cpu_air_prover ./cpu_air_prover-linux-${TARGET_ARCH} - mv /tmp/stone-prover/build/bazelbin/src/starkware/main/cpu/cpu_air_verifier ./cpu_air_verifier-linux-${TARGET_ARCH} - mv /tmp/stone-prover/stone-prover.deb /tmp/stone-prover/stone-prover-linux-${TARGET_ARCH}.deb - - - - name: Upload files to a GitHub release - uses: softprops/action-gh-release@v2 - with: - files: ./cpu_air* - - - name: Upload dep to a GitHub release - id: create_release_deb - uses: softprops/action-gh-release@v2 - with: - files: /tmp/stone-prover/stone-prover-linux-${TARGET_ARCH}.deb diff --git a/.github/workflows/mac-release.yml b/.github/workflows/mac-release.yml deleted file mode 100644 index f9f95079..00000000 --- a/.github/workflows/mac-release.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: MacOS release - -on: - push: - tags: - - 'v*.*.*' - -jobs: - build: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [macos-14] - arch: [x64, arm64] - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Set up environment - run: | - echo "Setting up environment for ${{ matrix.arch }}" - if [ "${{ matrix.arch }}" == "x64" ]; then - echo "TARGET_ARCH=x86_64" >> $GITHUB_ENV - elif [ "${{ matrix.arch }}" == "arm64" ]; then - echo "TARGET_ARCH=arm64" >> $GITHUB_ENV - fi - - - name: Build binary - run: | - chmod +x ./build_and_test.sh - ./build_and_test.sh - - - name: Rename binaries - run: | - echo "Renaming binaries to include architecture" - mv /tmp/stone-prover/build/bazelbin/src/starkware/main/cpu/cpu_air_prover ./cpu_air_prover-macOS-${TARGET_ARCH} - mv /tmp/stone-prover/build/bazelbin/src/starkware/main/cpu/cpu_air_verifier ./cpu_air_verifier-macOS-${TARGET_ARCH} - - - name: Upload files to a GitHub release - uses: softprops/action-gh-release@v2 - with: - files: ./cpu_air* diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 406f1a17..d5390c7c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,66 +7,50 @@ on: jobs: build: - name: Docker images for ghcr.io - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest] - arch: [linux/amd64, linux/arm64] - env: - ACTIONS_ALLOW_UNSECURE_COMMANDS: true - DOCKER_REGISTRY: ghcr.io - DOCKER_IMAGE_BASE: ${{ github.repository }} - steps: - - name: Check out the repo - uses: actions/checkout@v3 - - - name: Set up environment - run: | - echo "Setting up environment for ${{ matrix.arch }}" - if [ "${{ matrix.arch }}" == "linux/amd64" ]; then - echo "TARGET_ARCH=x86_64" >> $GITHUB_ENV - elif [ "${{ matrix.arch }}" == "linux/arm64" ]; then - echo "TARGET_ARCH=arm64" >> $GITHUB_ENV - fi - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Log in to the registry - uses: docker/login-action@v2 - with: - registry: ${{ env.DOCKER_REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - # Prover and Verifier and deb - - name: Set output - id: vars - run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT + os: [ubuntu-22.04, macos-14] + arch: [x64, arm64] - - name: Extract files and build DEB package - run: | - chmod +x ./build_deb.sh # Ensure your script is executable - ./build_deb.sh ${{ steps.vars.outputs.tag }} - - - name: Verify file existence#2 - run: ls -la /tmp/stone-prover - - - name: Rename binaries and deb - run: | - echo "Renaming binaries to include architecture" - mv /tmp/stone-prover/usr/bin/cpu_air_prover ./cpu_air_prover-linux-${TARGET_ARCH} - mv /tmp/stone-prover/usr/bin/cpu_air_verifier ./cpu_air_verifier-linux-${TARGET_ARCH} - mv /tmp/stone-prover/stone-prover.deb /tmp/stone-prover/stone-prover-linux-${TARGET_ARCH}.deb - - - name: Upload files to a GitHub release - uses: softprops/action-gh-release@v2 - with: - files: ./cpu_air* - - - name: Upload dep to a GitHub release - id: create_release_deb - uses: softprops/action-gh-release@v2 - with: - files: /tmp/stone-prover/stone-prover-linux-${TARGET_ARCH}.deb + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up environment + run: | + echo "Setting up environment for ${{ matrix.arch }}" + if [ "${{ matrix.arch }}" == "x64" ]; then + echo "TARGET_ARCH=x86_64" >> $GITHUB_ENV + elif [ "${{ matrix.arch }}" == "arm64" ]; then + echo "TARGET_ARCH=arm64" >> $GITHUB_ENV + fi + + - name: Build and Test + run: | + chmod +x ./build_and_test.sh + ./build_and_test.sh + + - name: Set output + id: vars + run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT + + - name: Extract files and build DEB package + if: matrix.os == 'ubuntu-22.04' + run: | + chmod +x ./package_deb.sh + ./package_deb.sh ${{ steps.vars.outputs.tag }} + + - name: Rename binaries + run: | + echo "Renaming binaries to include architecture" + mv /tmp/stone-prover/build/bazelbin/src/starkware/main/cpu/cpu_air_prover ./cpu_air_prover-linux-${TARGET_ARCH} + mv /tmp/stone-prover/build/bazelbin/src/starkware/main/cpu/cpu_air_verifier ./cpu_air_verifier-linux-${TARGET_ARCH} + mv /tmp/stone-prover/stone-prover.deb /tmp/stone-prover/stone-prover-linux-${TARGET_ARCH}.deb + + - name: Upload files to a GitHub release + uses: softprops/action-gh-release@v2 + with: + files: | + ./cpu_air* + /tmp/stone-prover/stone-prover-linux-${TARGET_ARCH}.deb \ No newline at end of file diff --git a/build_and_test.sh b/build_and_test.sh index cd4af313..c6eb11e8 100644 --- a/build_and_test.sh +++ b/build_and_test.sh @@ -1,5 +1,7 @@ #!/bin/bash +set -e + git clone https://github.com/baking-bad/stone-prover.git /tmp/stone-prover cd /tmp/stone-prover || exit @@ -11,8 +13,8 @@ bazelisk build //... bazelisk test //... # 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 /bin/cpu_air_prover -ln -s /tmp/stone-prover/build/bazelbin/src/starkware/main/cpu/cpu_air_verifier /bin/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 cd /tmp/stone-prover/e2e_test/CairoZero || exit diff --git a/build_deb.sh b/build_deb.sh deleted file mode 100755 index d7c363f1..00000000 --- a/build_deb.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash - -set -e - -sudo apt-get install -y build-essential devscripts debhelper dh-make - -# Create a temporary directory for the package -mkdir -p /tmp/stone-prover/DEBIAN -mkdir -p /tmp/stone-prover/usr/bin - -TAG=$1 - -docker build --tag prover . -container_id=$(docker create prover) -docker cp $container_id:/usr/bin/cpu_air_prover /tmp/stone-prover/usr/bin/cpu_air_prover -docker cp $container_id:/usr/bin/cpu_air_verifier /tmp/stone-prover/usr/bin/cpu_air_verifier -docker rm $container_id - -cat < /tmp/stone-prover/DEBIAN/control -Package: stone-prover -Version: $(echo $TAG | cut -c 2-) -Architecture: all -Depends: libdw1 -Maintainer: Zaariel91 na@baking-bad.org -Description: Stone prover deb package -EOF - -dpkg-deb --build /tmp/stone-prover /tmp/stone-prover/stone-prover.deb diff --git a/build_mac.sh b/build_mac.sh deleted file mode 100644 index 1f5c2139..00000000 --- a/build_mac.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -brew install gmp - -python3 -m pip install cpplint pytest numpy sympy==1.12.1 cairo-lang==0.12.0 - -git clone https://github.com/baking-bad/stone-prover.git /tmp/stone-prover - -cd /tmp/stone-prover || exit - -bazelisk build //... - -bazelisk test //... -