Skip to content

Commit a9e2b59

Browse files
committed
ci: add a release pipeline (#440)
1 parent 496636d commit a9e2b59

File tree

17 files changed

+196
-35
lines changed

17 files changed

+196
-35
lines changed

.github/changelog.sh

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/sh
2+
#
3+
# This is a hack to palliate the fact that cargo-release runs the pre-release
4+
# hook once for each crate, instead of only once for the whole workspace.
5+
# Calling git-cliff multiple times with the same argument is idempotent, so we
6+
# call it with settings generating the workspace-level changelog once for every
7+
# crate.
8+
git-cliff -o $WORKSPACE_ROOT/CHANGELOG.md --tag $NEW_VERSION -w $WORKSPACE_ROOT
9+
echo $NEW_VERSION > $WORKSPACE_ROOT/VERSION

.github/workflows/prepare-release.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Open a release PR
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
bump:
6+
description: Release Level
7+
required: true
8+
type: choice
9+
options:
10+
- patch
11+
- minor
12+
- major
13+
14+
jobs:
15+
make-release-pr:
16+
permissions:
17+
id-token: write
18+
pull-requests: write
19+
contents: write
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v4
23+
- uses: chainguard-dev/actions/setup-gitsign@main
24+
- name: Install tooling
25+
uses: taiki-e/install-action@v2
26+
with:
27+
tool: cargo-release,git-cliff
28+
- uses: cargo-bins/release-pr@v2
29+
with:
30+
version: ${{ inputs.bump }}
31+
github-token: ${{ secrets.GITHUB_TOKEN }}
32+
# Keep all the crates versions in sync
33+
crate-release-all: true

.github/workflows/release.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Create Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
create-release:
10+
runs-on: ubuntu-latest
11+
if: startsWith( github.event.head_commit.message, 'release:' )
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: Get version
15+
id: set-tag
16+
run: echo "tag=$(cat VERSION)" >> $GITHUB_OUTPUT
17+
- uses: ncipollo/release-action@v1
18+
with:
19+
allowUpdates: true
20+
omitBody: true
21+
commit: "main"
22+
tag: ${{ steps.set-tag.outputs.tag }}

CHANGELOG.md

Whitespace-only changes.

Cargo.toml

+4
Original file line numberDiff line numberDiff line change
@@ -121,3 +121,7 @@ lto = "fat"
121121
plonky2 = { git = "https://github.com/Lagrange-Labs/plonky2", branch = "upstream" }
122122
plonky2_monolith = { git = "https://github.com/Lagrange-Labs/monolith" }
123123
plonky2_field = { git = "https://github.com/Lagrange-Labs/plonky2", branch = "upstream" }
124+
125+
[workspace.metadata.release]
126+
publish = false
127+
pre-release-hook = ["sh", "../.github/changelog.sh"]

VERSION

Whitespace-only changes.

cliff.toml

+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# git-cliff ~ default configuration file
2+
# https://git-cliff.org/docs/configuration
3+
#
4+
# Lines starting with "#" are comments.
5+
# Configuration options are organized into tables and keys.
6+
# See documentation for more information on available options.
7+
8+
[changelog]
9+
# template for the changelog header
10+
header = """
11+
# Changelog\n
12+
"""
13+
# template for the changelog body
14+
# https://keats.github.io/tera/docs/#introduction
15+
body = """
16+
{% if version %}\
17+
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
18+
{% else %}\
19+
## [unreleased]
20+
{% endif %}\
21+
{% if previous %}\
22+
{% if previous.commit_id and commit_id %}
23+
[{{ previous.commit_id | truncate(length=7, end="") }}]({{ previous.commit_id }})...\
24+
[{{ commit_id | truncate(length=7, end="") }}]({{ commit_id }})
25+
{% endif %}\
26+
{% endif %}\
27+
{% for group, commits in commits | group_by(attribute="group") %}
28+
### {{ group | striptags | trim | upper_first }}
29+
{% for commit in commits | filter(attribute="scope") | sort(attribute="scope") %}
30+
- {% if commit.scope %}*({{ commit.scope }})* {% endif %}\
31+
{% if commit.breaking %}[**breaking**] {% endif %}\
32+
{{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}]({{ commit.id }}))\\
33+
{% endfor %}
34+
{% raw %}\n{% endraw %}\
35+
{%- for commit in commits %}
36+
- {{ commit.message | upper_first }}
37+
{% endfor -%}
38+
{% raw %}\n{% endraw %}\
39+
{% endfor %}\n
40+
"""
41+
# template for the changelog footer
42+
footer = """
43+
<!-- generated by git-cliff -->
44+
"""
45+
# remove the leading and trailing s
46+
trim = true
47+
# postprocessors
48+
postprocessors = [
49+
# { pattern = '<REPO>', replace = "https://github.com/orhun/git-cliff" }, # replace repository URL
50+
]
51+
# render body even when there are no releases to process
52+
# render_always = true
53+
# output file path
54+
# output = "test.md"
55+
56+
[git]
57+
# parse the commits based on https://www.conventionalcommits.org
58+
conventional_commits = true
59+
# filter out the commits that are not conventional
60+
filter_unconventional = true
61+
# process each line of a commit as an individual commit
62+
split_commits = false
63+
# regex for preprocessing the commit messages
64+
commit_preprocessors = [
65+
# Replace issue numbers
66+
#{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](<REPO>/issues/${2}))"},
67+
# Check spelling of the commit with https://github.com/crate-ci/typos
68+
# If the spelling is incorrect, it will be automatically fixed.
69+
#{ pattern = '.*', replace_command = 'typos --write-changes -' },
70+
]
71+
# regex for parsing and grouping commits
72+
commit_parsers = [
73+
{ message = "^feat", group = "<!-- 0 -->Features" },
74+
{ message = "^fix", group = "<!-- 1 -->Bug Fixes" },
75+
{ message = "^doc", group = "<!-- 3 -->Documentation" },
76+
{ message = "^perf", group = "<!-- 4 -->Performance" },
77+
{ message = "^refactor", group = "<!-- 2 -->Refactor" },
78+
{ message = "^style", group = "<!-- 5 -->Styling" },
79+
{ message = "^test", group = "<!-- 6 -->Testing" },
80+
{ message = "^chore\\(release\\): prepare for", skip = true },
81+
{ message = "^chore\\(deps.*\\)", skip = true },
82+
{ message = "^chore\\(pr\\)", skip = true },
83+
{ message = "^chore\\(pull\\)", skip = true },
84+
{ message = "^chore|^ci", group = "<!-- 7 -->Miscellaneous Tasks" },
85+
{ body = ".*security", group = "<!-- 8 -->Security" },
86+
{ message = "^revert", group = "<!-- 9 -->Revert" },
87+
]
88+
# filter out the commits that are not matched by commit parsers
89+
filter_commits = false
90+
# sort the tags topologically
91+
topo_order = false
92+
# sort the commits inside sections by oldest/newest order
93+
sort_commits = "oldest"

gnark-utils/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "gnark-utils"
3-
version = "0.1.0"
3+
version = "1.1.3"
44
edition = "2021"
55

66
[build-dependencies]

groth16-framework/Cargo.toml

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "groth16_framework"
3-
version = "0.1.0"
3+
version = "1.1.3"
44
edition = "2021"
55

66
[dependencies]
@@ -14,16 +14,16 @@ revm.workspace = true
1414
serde.workspace = true
1515
serde_json.workspace = true
1616

17-
gnark-utils = { path = "../gnark-utils" }
18-
mp2_common = { path = "../mp2-common" }
17+
gnark-utils = { path = "../gnark-utils" , version = "1.1.3" }
18+
mp2_common = { path = "../mp2-common" , version = "1.1.3" }
1919

2020
[dev-dependencies]
2121
env_logger.workspace = true
2222
itertools.workspace = true
2323
rand.workspace = true
2424
serial_test.workspace = true
2525
sha2.workspace = true
26-
mp2_test = { path = "../mp2-test" }
26+
mp2_test = { path = "../mp2-test" , version = "1.1.3" }
2727

28-
recursion_framework = { path = "../recursion-framework" }
29-
verifiable-db = { path = "../verifiable-db" }
28+
recursion_framework = { path = "../recursion-framework" , version = "1.1.3" }
29+
verifiable-db = { path = "../verifiable-db" , version = "1.1.3" }

inspect/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "inspect"
3-
version = "0.1.0"
3+
version = "1.1.3"
44
edition = "2021"
55

66
[dependencies]
@@ -14,5 +14,5 @@ serde.workspace = true
1414
tabled.workspace = true
1515
tokio.workspace = true
1616

17-
ryhope = { path = "../ryhope" }
18-
mp2_v1 = { path = "../mp2-v1" }
17+
ryhope = { path = "../ryhope" , version = "1.1.3" }
18+
mp2_v1 = { path = "../mp2-v1" , version = "1.1.3" }

mp2-common/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "mp2_common"
3-
version = "0.1.0"
3+
version = "1.1.3"
44
edition = "2021"
55

66
[dependencies]
@@ -33,7 +33,7 @@ rand.workspace = true
3333
rstest.workspace = true
3434
tokio.workspace = true
3535

36-
mp2_test = { path = "../mp2-test" }
36+
mp2_test = { path = "../mp2-test" , version = "1.1.3" }
3737

3838
[features]
3939
ci = ["mp2_test/ci"]

mp2-test/Cargo.toml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "mp2_test"
3-
version = "0.1.0"
3+
version = "1.1.3"
44
edition = "2021"
55

66
[dependencies]
@@ -14,9 +14,9 @@ plonky2_ecgfp5.workspace = true
1414
rand.workspace = true
1515
serde.workspace = true
1616

17-
mp2_common = { path = "../mp2-common" }
18-
recursion_framework = { path = "../recursion-framework" }
19-
ryhope = { path = "../ryhope" }
17+
mp2_common = { path = "../mp2-common" , version = "1.1.3" }
18+
recursion_framework = { path = "../recursion-framework" , version = "1.1.3" }
19+
ryhope = { path = "../ryhope" , version = "1.1.3" }
2020

2121
[features]
2222
ci = []

mp2-v1/Cargo.toml

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "mp2_v1" # TODO: fix the name to a meaningful one.
3-
version = "0.1.0"
3+
version = "1.1.3"
44
edition = "2021"
55

66
[dependencies]
@@ -27,11 +27,11 @@ serde_json.workspace = true
2727
tokio-postgres.workspace = true
2828
tracing.workspace = true
2929

30-
mp2_common = { path = "../mp2-common" }
31-
recursion_framework = { path = "../recursion-framework" }
32-
ryhope = { path = "../ryhope" }
33-
parsil = { path = "../parsil" }
34-
verifiable-db = { path = "../verifiable-db" }
30+
mp2_common = { path = "../mp2-common" , version = "1.1.3" }
31+
recursion_framework = { path = "../recursion-framework" , version = "1.1.3" }
32+
ryhope = { path = "../ryhope" , version = "1.1.3" }
33+
parsil = { path = "../parsil" , version = "1.1.3" }
34+
verifiable-db = { path = "../verifiable-db" , version = "1.1.3" }
3535

3636
[dev-dependencies]
3737
alloy.workspace = true
@@ -54,8 +54,8 @@ testfile.workspace = true
5454
tokio-postgres.workspace = true
5555
tokio.workspace = true
5656

57-
mp2_test = { path = "../mp2-test" }
58-
parsil = { path = "../parsil" }
57+
mp2_test = { path = "../mp2-test" , version = "1.1.3" }
58+
parsil = { path = "../parsil" , version = "1.1.3" }
5959

6060
[features]
6161
original_poseidon = ["mp2_common/original_poseidon"]

parsil/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "parsil"
3-
version = "0.1.0"
3+
version = "1.1.3"
44
edition = "2021"
55

66
[lib]
@@ -24,8 +24,8 @@ sqlparser.workspace = true
2424
stderrlog = { workspace = true, optional = true }
2525
thiserror.workspace = true
2626

27-
ryhope = { path = "../ryhope" }
28-
verifiable-db = { path = "../verifiable-db" }
27+
ryhope = { path = "../ryhope" , version = "1.1.3" }
28+
verifiable-db = { path = "../verifiable-db" , version = "1.1.3" }
2929

3030
[features]
3131
cli = ["dep:stderrlog", "dep:clap"]

recursion-framework/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "recursion_framework"
3-
version = "0.1.0"
3+
version = "1.1.3"
44
edition = "2021"
55

66
[dependencies]
@@ -9,7 +9,7 @@ log.workspace = true
99
plonky2.workspace = true
1010
serde.workspace = true
1111

12-
mp2_common = { path = "../mp2-common" }
12+
mp2_common = { path = "../mp2-common" , version = "1.1.3" }
1313

1414
[dev-dependencies]
1515
bincode.workspace = true

ryhope/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ryhope"
3-
version = "0.1.0"
3+
version = "1.1.3"
44
edition = "2021"
55

66
[lib]

verifiable-db/Cargo.toml

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "verifiable-db"
3-
version = "0.1.0"
3+
version = "1.1.3"
44
edition = "2021"
55

66
[dependencies]
@@ -17,10 +17,10 @@ plonky2_ecgfp5.workspace = true
1717
rand.workspace = true
1818
serde.workspace = true
1919

20-
mp2_common = { path = "../mp2-common" }
21-
recursion_framework = { path = "../recursion-framework" }
22-
ryhope = { path = "../ryhope" }
23-
mp2_test = { path = "../mp2-test" }
20+
mp2_common = { path = "../mp2-common" , version = "1.1.3" }
21+
recursion_framework = { path = "../recursion-framework" , version = "1.1.3" }
22+
ryhope = { path = "../ryhope" , version = "1.1.3" }
23+
mp2_test = { path = "../mp2-test" , version = "1.1.3" }
2424

2525
[dev-dependencies]
2626
futures.workspace = true

0 commit comments

Comments
 (0)