From 9d402df0cfa1a3b9a0247e5046d7916533977e47 Mon Sep 17 00:00:00 2001 From: Jeremy Felder Date: Wed, 6 Mar 2024 21:41:48 +0200 Subject: [PATCH] Release flow CI (#423) ## Describe the changes This PR: - Moves common crate attributes to the workspace Cargo.toml. - Adds a manual release flow for bumping, tagging, and draft release --- .github/workflows/release.yml | 34 +++++++++++++++++++ scripts/bump_rust_versions.sh | 15 -------- wrappers/rust/Cargo.toml | 14 ++++++++ wrappers/rust/icicle-core/Cargo.toml | 12 +++---- wrappers/rust/icicle-cuda-runtime/Cargo.toml | 12 +++---- .../icicle-curves/icicle-bls12-377/Cargo.toml | 14 ++++---- .../icicle-curves/icicle-bls12-381/Cargo.toml | 14 ++++---- .../icicle-curves/icicle-bn254/Cargo.toml | 14 ++++---- .../icicle-curves/icicle-bw6-761/Cargo.toml | 14 ++++---- .../icicle-curve-template/Cargo.toml | 14 ++++---- .../icicle-curves/icicle-grumpkin/Cargo.toml | 14 ++++---- 11 files changed, 102 insertions(+), 69 deletions(-) create mode 100644 .github/workflows/release.yml delete mode 100755 scripts/bump_rust_versions.sh diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..1f8ebd69f --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,34 @@ +name: Release + +on: + workflow_dispatch: + inputs: + releaseType: + description: 'Release type' + required: true + default: 'minor' + type: choice + options: + - patch + - minor + - major + +jobs: + release: + name: Release + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Bump rust crate versions, commit, and tag + working-directory: wrappers/rust + # https://github.com/pksunkara/cargo-workspaces?tab=readme-ov-file#version + run: | + cargo install cargo-workspaces + cargo workspaces version ${{ inputs.releaseType }} -y --no-individual-tags -m "Bump rust crates' version" + - name: Create draft release + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + LATEST_TAG=$(git describe --tags --abbrev=0) + gh release create $LATEST_TAG --generate-notes -d --verify-tag -t "Release $LATEST_TAG" diff --git a/scripts/bump_rust_versions.sh b/scripts/bump_rust_versions.sh deleted file mode 100755 index e633fa17a..000000000 --- a/scripts/bump_rust_versions.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -new_version=$1 - -if [ -z "$new_version" ]; then - echo "Usage: ./bump_rust_versions.sh " - exit 1 -fi - -cd wrappers/rust - -# Update the version in each member crate's Cargo.toml -for crate in $(cat Cargo.toml | grep '"[a-z].*"' | tr -d '[" ],'); do - sed -i "/^\[package\]/,/^$/ s/^version = \".*\"/version = \"$new_version\"/" $crate/Cargo.toml -done \ No newline at end of file diff --git a/wrappers/rust/Cargo.toml b/wrappers/rust/Cargo.toml index 9d3e0e1ab..2e7631aa5 100644 --- a/wrappers/rust/Cargo.toml +++ b/wrappers/rust/Cargo.toml @@ -9,3 +9,17 @@ members = [ "icicle-curves/icicle-bn254", "icicle-curves/icicle-grumpkin", ] +exclude = [ + "icicle-curves/icicle-curve-template", +] + +[workspace.package] +version = "1.6.0" +edition = "2021" +authors = [ "Ingonyama" ] +homepage = "https://www.ingonyama.com" +repository = "https://github.com/ingonyama-zk/icicle" + +[workspace.dependencies] +icicle-core = { path = "icicle-core" } +icicle-cuda-runtime = { path = "icicle-cuda-runtime" } diff --git a/wrappers/rust/icicle-core/Cargo.toml b/wrappers/rust/icicle-core/Cargo.toml index 8aaccccc6..2bf9c7f17 100644 --- a/wrappers/rust/icicle-core/Cargo.toml +++ b/wrappers/rust/icicle-core/Cargo.toml @@ -1,16 +1,16 @@ [package] name = "icicle-core" -version = "1.6.0" -edition = "2021" -authors = ["Ingonyama"] +version.workspace = true +edition.workspace = true +authors.workspace = true description = "A library for GPU ZK acceleration by Ingonyama" -homepage = "https://www.ingonyama.com" -repository = "https://github.com/ingonyama-zk/icicle" +homepage.workspace = true +repository.workspace = true [dependencies] -icicle-cuda-runtime = { path = "../icicle-cuda-runtime" } +icicle-cuda-runtime = { workspace = true } ark-ff = { version = "0.4.0", optional = true } ark-ec = { version = "0.4.0", optional = true, features = ["parallel"] } diff --git a/wrappers/rust/icicle-cuda-runtime/Cargo.toml b/wrappers/rust/icicle-cuda-runtime/Cargo.toml index fd81159ed..a0853ef6d 100644 --- a/wrappers/rust/icicle-cuda-runtime/Cargo.toml +++ b/wrappers/rust/icicle-cuda-runtime/Cargo.toml @@ -1,15 +1,15 @@ [package] name = "icicle-cuda-runtime" -version = "1.6.0" -edition = "2021" -authors = [ "Ingonyama" ] +version.workspace = true +edition.workspace = true +authors.workspace = true description = "Ingonyama's Rust wrapper of CUDA runtime" -homepage = "https://www.ingonyama.com" -repository = "https://github.com/ingonyama-zk/icicle" +homepage.workspace = true +repository.workspace = true rust-version = "1.70.0" [dependencies] bitflags = "1.3" [build-dependencies] -bindgen = "0.69.4" \ No newline at end of file +bindgen = "0.69.4" diff --git a/wrappers/rust/icicle-curves/icicle-bls12-377/Cargo.toml b/wrappers/rust/icicle-curves/icicle-bls12-377/Cargo.toml index 611c63eec..236ffdc73 100644 --- a/wrappers/rust/icicle-curves/icicle-bls12-377/Cargo.toml +++ b/wrappers/rust/icicle-curves/icicle-bls12-377/Cargo.toml @@ -1,15 +1,15 @@ [package] name = "icicle-bls12-377" -version = "1.6.0" -edition = "2021" -authors = [ "Ingonyama" ] +version.workspace = true +edition.workspace = true +authors.workspace = true description = "Rust wrapper for the CUDA implementation of BLS12-377 pairing friendly elliptic curve by Ingonyama" -homepage = "https://www.ingonyama.com" -repository = "https://github.com/ingonyama-zk/icicle" +homepage.workspace = true +repository.workspace = true [dependencies] -icicle-core = { path = "../../icicle-core" } -icicle-cuda-runtime = { path = "../../icicle-cuda-runtime" } +icicle-core = { workspace = true } +icicle-cuda-runtime = { workspace = true } ark-bls12-377 = { version = "0.4.0", optional = true } [build-dependencies] diff --git a/wrappers/rust/icicle-curves/icicle-bls12-381/Cargo.toml b/wrappers/rust/icicle-curves/icicle-bls12-381/Cargo.toml index 9aeca5a0a..5486b0bdf 100644 --- a/wrappers/rust/icicle-curves/icicle-bls12-381/Cargo.toml +++ b/wrappers/rust/icicle-curves/icicle-bls12-381/Cargo.toml @@ -1,15 +1,15 @@ [package] name = "icicle-bls12-381" -version = "1.6.0" -edition = "2021" -authors = [ "Ingonyama" ] +version.workspace = true +edition.workspace = true +authors.workspace = true description = "Rust wrapper for the CUDA implementation of BLS12-381 pairing friendly elliptic curve by Ingonyama" -homepage = "https://www.ingonyama.com" -repository = "https://github.com/ingonyama-zk/icicle" +homepage.workspace = true +repository.workspace = true [dependencies] -icicle-core = { path = "../../icicle-core" } -icicle-cuda-runtime = { path = "../../icicle-cuda-runtime" } +icicle-core = { workspace = true } +icicle-cuda-runtime = { workspace = true } ark-bls12-381 = { version = "0.4.0", optional = true } [build-dependencies] diff --git a/wrappers/rust/icicle-curves/icicle-bn254/Cargo.toml b/wrappers/rust/icicle-curves/icicle-bn254/Cargo.toml index 516c0d17b..4530abb79 100644 --- a/wrappers/rust/icicle-curves/icicle-bn254/Cargo.toml +++ b/wrappers/rust/icicle-curves/icicle-bn254/Cargo.toml @@ -1,15 +1,15 @@ [package] name = "icicle-bn254" -version = "1.6.0" -edition = "2021" -authors = [ "Ingonyama" ] +version.workspace = true +edition.workspace = true +authors.workspace = true description = "Rust wrapper for the CUDA implementation of BN254 pairing friendly elliptic curve by Ingonyama" -homepage = "https://www.ingonyama.com" -repository = "https://github.com/ingonyama-zk/icicle" +homepage.workspace = true +repository.workspace = true [dependencies] -icicle-core = { path = "../../icicle-core" } -icicle-cuda-runtime = { path = "../../icicle-cuda-runtime" } +icicle-core = { workspace = true } +icicle-cuda-runtime = { workspace = true } ark-bn254 = { version = "0.4.0", optional = true } [build-dependencies] diff --git a/wrappers/rust/icicle-curves/icicle-bw6-761/Cargo.toml b/wrappers/rust/icicle-curves/icicle-bw6-761/Cargo.toml index fd9383a02..f7351e9b7 100644 --- a/wrappers/rust/icicle-curves/icicle-bw6-761/Cargo.toml +++ b/wrappers/rust/icicle-curves/icicle-bw6-761/Cargo.toml @@ -1,15 +1,15 @@ [package] name = "icicle-bw6-761" -version = "1.6.0" -edition = "2021" -authors = [ "Ingonyama" ] +version.workspace = true +edition.workspace = true +authors.workspace = true description = "Rust wrapper for the CUDA implementation of BW6-761 pairing friendly elliptic curve by Ingonyama" -homepage = "https://www.ingonyama.com" -repository = "https://github.com/ingonyama-zk/icicle" +homepage.workspace = true +repository.workspace = true [dependencies] -icicle-core = { path = "../../icicle-core" } -icicle-cuda-runtime = { path = "../../icicle-cuda-runtime" } +icicle-core = { workspace = true } +icicle-cuda-runtime = { workspace = true } icicle-bls12-377 = { path = "../../icicle-curves/icicle-bls12-377", features = ["bw6-761"] } ark-bw6-761 = { version = "0.4.0", optional = true } diff --git a/wrappers/rust/icicle-curves/icicle-curve-template/Cargo.toml b/wrappers/rust/icicle-curves/icicle-curve-template/Cargo.toml index 7872e5b09..ba0d66884 100644 --- a/wrappers/rust/icicle-curves/icicle-curve-template/Cargo.toml +++ b/wrappers/rust/icicle-curves/icicle-curve-template/Cargo.toml @@ -1,15 +1,15 @@ [package] name = "icicle-" -version = "1.4.0" -edition = "2021" -authors = [ "Ingonyama" ] +version.workspace = true +edition.workspace = true +authors.workspace = true description = "Rust wrapper for the CUDA implementation of elliptic curve by Ingonyama" -homepage = "https://www.ingonyama.com" -repository = "https://github.com/ingonyama-zk/icicle" +homepage.workspace = true +repository.workspace = true [dependencies] -icicle-core = { path = "../../icicle-core" } -icicle-cuda-runtime = { path = "../../icicle-cuda-runtime" } +icicle-core = { workspace = true } +icicle-cuda-runtime = { workspace = true } ark- = { version = "0.4.0", optional = true } [build-dependencies] diff --git a/wrappers/rust/icicle-curves/icicle-grumpkin/Cargo.toml b/wrappers/rust/icicle-curves/icicle-grumpkin/Cargo.toml index 772a7ef8a..dc26326b0 100644 --- a/wrappers/rust/icicle-curves/icicle-grumpkin/Cargo.toml +++ b/wrappers/rust/icicle-curves/icicle-grumpkin/Cargo.toml @@ -1,15 +1,15 @@ [package] name = "icicle-grumpkin" -version = "1.6.0" -edition = "2021" -authors = [ "Ingonyama" ] +version.workspace = true +edition.workspace = true +authors.workspace = true description = "Rust wrapper for the CUDA implementation of Grumpkin elliptic curve by Ingonyama" -homepage = "https://www.ingonyama.com" -repository = "https://github.com/ingonyama-zk/icicle" +homepage.workspace = true +repository.workspace = true [dependencies] -icicle-core = { path = "../../icicle-core" } -icicle-cuda-runtime = { path = "../../icicle-cuda-runtime" } +icicle-core = { workspace = true } +icicle-cuda-runtime = { workspace = true } ark-grumpkin-test = { git = "https://github.com/ingonyama-zk/ark-grumpkin-test.git", optional = true} [build-dependencies]