From e807209588f3d4ef08c5f03e52c3b6d06b993e57 Mon Sep 17 00:00:00 2001 From: plebhash Date: Tue, 2 Apr 2024 17:14:29 -0300 Subject: [PATCH 1/2] unify jobs --- .github/workflows/release-libs.yaml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release-libs.yaml b/.github/workflows/release-libs.yaml index 9789608a52..d94cc5e649 100644 --- a/.github/workflows/release-libs.yaml +++ b/.github/workflows/release-libs.yaml @@ -16,7 +16,7 @@ on: - main jobs: - check_versioning_lib_release: + libs_publish: runs-on: ubuntu-latest steps: - name: Checkout code @@ -30,14 +30,11 @@ jobs: exit 1 fi - libs_publish: - runs-on: ubuntu-latest - steps: - uses: actions/checkout@v3 - uses: actions-rs/toolchain@v1 with: - toolchain: stable - override: true + toolchain: stable + override: true - name: Login run: cargo login ${{ secrets.CRATES_IO_DEPLOY_KEY }} - name: Publish crate common From 63760027e393a0c4b82e6a2f860a6c9028246002 Mon Sep 17 00:00:00 2001 From: plebhash Date: Tue, 2 Apr 2024 17:18:51 -0300 Subject: [PATCH 2/2] fix check-versioning-lib-release.sh --- check-versioning-lib-release.sh | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/check-versioning-lib-release.sh b/check-versioning-lib-release.sh index 0ef1d58001..b78c31412f 100755 --- a/check-versioning-lib-release.sh +++ b/check-versioning-lib-release.sh @@ -5,27 +5,36 @@ crates=$(find . -name Cargo.toml -exec dirname {} \; | sort) # Filter out crates that are not published to crates.io filter=("benches" "examples" "test" "roles") -for f in "${filter[@]}"; do - crates=$(echo "$crates" | grep -v "$f") +for crate in $crates; do + filtered=false + for f in "${filter[@]}"; do + if [ "$crate" = "./$f" ]; then + filtered=true + break + fi + done + if [ "$filtered" = false ]; then + filtered_crates+=("$crate") + fi done +crates="${filtered_crates[@]}" + # Loop through each crate, while avoiding root workspace Cargo.toml and files under `target` directory for crate in $crates; do if [ "$crate" != "./protocols" ] && \ [ "$crate" != "./common" ] && \ - [ "$crate" != "./roles" ] && \ - [ "$crate" != "./utils" ] && \ ! echo "$crate" | grep -q "target"; then cd "$crate" # Check if there were any changes between dev and main - git diff --quiet "dev" "main" -- . + git diff --quiet "origin/dev" "origin/main" -- . if [ $? -ne 0 ]; then # Check if crate versions on dev and main are identical - version_dev=$(git show dev:./Cargo.toml | awk -F' = ' '$1 == "version" {gsub(/[ "]+/, "", $2); print $2}') - version_main=$(git show main:./Cargo.toml | awk -F' = ' '$1 == "version" {gsub(/[ "]+/, "", $2); print $2}') + version_dev=$(git show origin/dev:./Cargo.toml | awk -F' = ' '$1 == "version" {gsub(/[ "]+/, "", $2); print $2}') + version_main=$(git show origin/main:./Cargo.toml | awk -F' = ' '$1 == "version" {gsub(/[ "]+/, "", $2); print $2}') if [ "$version_dev" = "$version_main" ]; then echo "Changes detected in crate $crate between dev and main branches! Versions on dev and main branches are identical ($version_dev), so you should bump the crate version on dev before merging into main." exit 1