Skip to content

Commit

Permalink
Merge releases
Browse files Browse the repository at this point in the history
  • Loading branch information
dmirgaleev committed Aug 18, 2024
1 parent 6f2515a commit f3bd161
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 207 deletions.
60 changes: 0 additions & 60 deletions .github/workflows/linux-release.yml

This file was deleted.

43 changes: 0 additions & 43 deletions .github/workflows/mac-release.yml

This file was deleted.

104 changes: 44 additions & 60 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 4 additions & 2 deletions build_and_test.sh
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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

Expand Down
28 changes: 0 additions & 28 deletions build_deb.sh

This file was deleted.

14 changes: 0 additions & 14 deletions build_mac.sh

This file was deleted.

0 comments on commit f3bd161

Please sign in to comment.