-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Package versioning updated to be the same with zkLLVM packages.
- Loading branch information
Showing
2 changed files
with
108 additions
and
75 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 |
---|---|---|
@@ -1,12 +1,16 @@ | ||
name: Build | ||
name: Make release | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- 'master' | ||
tags: | ||
- '**' | ||
workflow_dispatch: | ||
inputs: | ||
release_type: | ||
type: choice | ||
description: Release type | ||
options: | ||
- major | ||
- minor | ||
- patch | ||
default: minor | ||
|
||
jobs: | ||
handle-syncwith: | ||
|
@@ -18,14 +22,8 @@ jobs: | |
secrets: inherit | ||
|
||
|
||
build-linux: | ||
runs-on: [ "self-hosted", "aws_autoscaling"] | ||
|
||
needs: | ||
- handle-syncwith | ||
|
||
# skipped status occurs on push event | ||
if: ${{ needs.handle-syncwith.result == 'success' || needs.handle-syncwith.result == 'skipped' }} | ||
make-release-linux: | ||
runs-on: [ "self-hosted", Linux, X64, "aws_autoscaling"] | ||
|
||
env: | ||
CONTAINER_TMP: /opt/ | ||
|
@@ -78,21 +76,6 @@ jobs: | |
submodules: 'recursive' | ||
fetch-depth: 0 | ||
|
||
- name: Checkout modules to specified refs | ||
if: needs.handle-syncwith.outputs.prs-refs != '' | ||
uses: NilFoundation/ci-cd/actions/[email protected] | ||
# TODO: figure out the mapping of volumes and use variable here, not hardcoded path | ||
with: | ||
paths: | | ||
/__w/proof-producer/proof-producer/** | ||
!/__w/proof-producer/proof-producer/**/.git/** | ||
refs: ${{ needs.handle-syncwith.outputs.prs-refs }} | ||
|
||
- name: Install Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
|
||
# Workaround: https://github.com/actions/checkout/issues/1169 | ||
- name: Mark directory as safe | ||
run: | | ||
|
@@ -110,67 +93,82 @@ jobs: | |
toolset: gcc | ||
arch: x86 | ||
|
||
- name: Set VERSION variable | ||
# required for building deb packages | ||
# TODO: replace with getting version from git tag or commit SHA1 | ||
run: echo "VERSION=$(cat VERSION)" >> $GITHUB_ENV | ||
- name: Install Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
|
||
- name: Install aws tools | ||
run: | | ||
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" | ||
unzip awscliv2.zip | ||
./aws/install | ||
pip3 install mkrepo | ||
# Workaround: https://github.com/actions/checkout/issues/1169 | ||
- name: Mark directory as safe | ||
run: | | ||
git config --system --add safe.directory $PWD | ||
- name: Compute release number | ||
env: | ||
RELEASE_TYPE: ${{ inputs.release_type }} | ||
run: | | ||
LATEST_TAG=`git describe --tags | cut -d'-' -f1 | tr -d v` | ||
MAJOR=`echo $LATEST_TAG | cut -d'.' -f1` | ||
MINOR=`echo $LATEST_TAG | cut -d'.' -f2` | ||
PATCH=`echo $LATEST_TAG | cut -d'.' -f3` | ||
case $RELEASE_TYPE in | ||
major) | ||
MAJOR=$((MAJOR+1)) | ||
MINOR=0 | ||
PATCH=0 | ||
;; | ||
minor) | ||
MINOR=$((MINOR+1)) | ||
PATCH=0 | ||
;; | ||
patch) | ||
PATCH=$((PATCH+1)) | ||
;; | ||
*) | ||
echo "Unknown release type" | ||
exit 1 | ||
;; | ||
esac | ||
echo "VERSION=$MAJOR.$MINOR.$PATCH" >> $GITHUB_ENV | ||
echo "VERSION=$MAJOR.$MINOR.$PATCH" | ||
- name: Configure CMake | ||
env: | ||
BOOST_ROOT: "${{ steps.install-boost.outputs.BOOST_ROOT }}" | ||
run: | | ||
cmake -G "Unix Makefiles" \ | ||
-B build \ | ||
-DCMAKE_BUILD_TYPE=Release | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DPROOF_PRODUCER_VERSION=${{ env.VERSION }} . | ||
- name: Build proof-producers (single- and multithreaded) | ||
# working-directory: build | ||
env: | ||
BOOST_ROOT: "${{ steps.install-boost.outputs.BOOST_ROOT }}" | ||
run: | | ||
cd build | ||
make | ||
cd .. | ||
# make -j $(nproc) -k | ||
- name: Create .deb package | ||
# always build deb packages to check that they're buildable | ||
# although, push them only on tags (see later) | ||
- name: Build packages | ||
run: | | ||
mkdir -p .debpkg/usr/bin | ||
cp ./build/bin/proof-generator/proof-generator .debpkg/usr/bin | ||
cp ./build/bin/proof-generator-multithreaded/proof-generator-multithreaded .debpkg/usr/bin | ||
make -C build package -j$(nproc) | ||
chmod +x .debpkg/usr/bin/proof-generator | ||
chmod +x .debpkg/usr/bin/proof-generator-multithreaded | ||
mkdir -p .debpkg/DEBIAN | ||
- uses: jiro4989/build-deb-action@v3 | ||
- name: Create release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
package: proof-generator | ||
package_root: .debpkg | ||
maintainer: =nil; Foundation | ||
version: ${{ env.VERSION }} | ||
arch: 'amd64' | ||
desc: 'zkllvm proof-generator' | ||
|
||
- name: Install aws tools | ||
# these steps run only on tag push => deb package release | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | ||
run: | | ||
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" | ||
unzip awscliv2.zip | ||
./aws/install | ||
pip3 install mkrepo | ||
name: "proof-producer_-v${{ env.VERSION }}" | ||
tag: "v${{ env.VERSION }}" | ||
artifacts: "build/proof-producer_*.deb" | ||
|
||
- name: Upload packages to repository | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | ||
env: | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} | ||
run: | | ||
PROOF_GENERATOR_PACKAGE=`ls proof-generator*.deb | cut -d'/' -f2` | ||
PROOF_PRODUCER_PACKAGE=`ls build/proof-producer_*.deb | cut -d'/' -f2` | ||
POOL="ubuntu/pool/main/p/proof-generator" | ||
aws s3api put-object --bucket deb.nil.foundation --key $POOL/$PROOF_GENERATOR_PACKAGE --body $PROOF_GENERATOR_PACKAGE | ||
mkrepo s3://deb.nil.foundation/ubuntu/ | ||
aws s3api put-object --bucket deb.nil.foundation --key $POOL/$PROOF_PRODUCER_PACKAGE --body $PROOF_PRODUCER_PACKAGE | ||
mkrepo s3://deb.nil.foundation/ubuntu/ |
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