-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b3a1a22
commit f668d65
Showing
3 changed files
with
88 additions
and
3 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,60 @@ | ||
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 /app/build/bazelbin/src/starkware/main/cpu/cpu_air_prover ./cpu_air_prover-linux-${TARGET_ARCH} | ||
mv /app/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 |
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,25 @@ | ||
#!/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 | ||
|
||
cp /bin/cpu_air_prover /tmp/stone-prover/usr/local/bin/ | ||
cp /bin/cpu_air_verifier /tmp/stone-prover/usr/local/bin/ | ||
|
||
cat <<EOF > /tmp/stone-prover/DEBIAN/control | ||
Package: stone-prover | ||
Version: $(echo $TAG | cut -c 2-) | ||
Architecture: all | ||
Depends: libdw1 | ||
Maintainer: Baking Bad [email protected] | ||
Description: Stone prover deb package | ||
EOF | ||
|
||
dpkg-deb --build /tmp/stone-prover /tmp/stone-prover/stone-prover.deb |