Skip to content

Commit

Permalink
ci: build deb always, push on tags
Browse files Browse the repository at this point in the history
* Build .deb packages on every CI run.
* Push them only when tags are pushed.
  Note: CI doesn't check that tagged commit belongs to a stable branch.
  Check it yourself.
* Update readme.md with info about .deb releases.

Remove the auto-tagging CI.
We don't need that many tags, because not every commit in master gets
a proper integration testing.
  • Loading branch information
NickVolynkin committed Nov 15, 2023
1 parent e006f05 commit af1e5bf
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 155 deletions.
49 changes: 47 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
name: Build

on:
pull_request:
push:
branches: [ 8-add-ci ]
branches:
- 'master'
tags:
- '**'

jobs:
build-linux:
Expand Down Expand Up @@ -83,4 +87,45 @@ jobs:
run: |
cd build
make
cd ..
- name: Create .deb package
# always build deb packages to check that they're buildable
# although, push them only on tags (see later)
run: |
mkdir -p .debpkg/usr/bin
cp ./build/bin/proof-generator/proof-generator .debpkg/usr/bin
chmod +x .debpkg/usr/bin/proof-generator
mkdir -p .debpkg/DEBIAN
- uses: jiro4989/build-deb-action@v3
with:
package: proof-generator
package_root: .debpkg
maintainer: =nil; Foundation
version: 0.1
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: 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`
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/
124 changes: 0 additions & 124 deletions .github/workflows/linux_release.yml

This file was deleted.

29 changes: 0 additions & 29 deletions .github/workflows/set_version.yml

This file was deleted.

21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,27 @@ ${ZKLLVM_BUILD:-build}/bin/assigner/assigner -b ${ZKLLVM_BUILD:-build}/examples/
./bin/proof-generator/proof-generator --circuit=./merkle_tree_sha2_256_circuit.crt --assignment-table=/balances_tree.tbl --proof=./proof.txt
```

# Releases

## DEB packages

Building DEB packages is tested on every CI run.
This way developers can be sure that their code can be built to a package
before they merge it.

To make a DEB release:

1. Update the version in the `VERSION` file, for example, `v0.42.0`.
2. Push this commit to the `master` branch.
3. Push a tag on this commit, named same as the version:

```
git tag v0.42.0
git push origin v0.42.0
```
4. Wait for CI to build and publish the package.
## Toolchain Docker image
Build an image:
Expand Down

0 comments on commit af1e5bf

Please sign in to comment.