diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 88e6a672f..5c9349814 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -44,7 +44,11 @@ jobs: with: repo: ${{ github.repository }} live-run: ${{ inputs.live-run || false }} - version: ${{ inputs.version }} + # NOTE(fuzzypixelz): When the version is undefined (e.g. on schedule + # events) we cannot use git-describe as CMake doesn't support it. + # However, we still need some placeholder version to test that the + # version can be reliably bumped. + version: ${{ inputs.version || '0.0.0' }} github-token: ${{ secrets.BOT_TOKEN_WORKFLOW }} - name: Checkout this repository @@ -57,7 +61,7 @@ jobs: env: VERSION: ${{ steps.create-release-branch.outputs.version }} BUMP_DEPS_VERSION: ${{ inputs.zenoh-version }} - BUMP_DEPS_PATTERN: ${{ inputs.zenoh-version && 'zenoh.*' || '^$' }} + BUMP_DEPS_PATTERN: ${{ inputs.zenoh-version && 'zenoh.*' || '' }} BUMP_DEPS_BRANCH: ${{ inputs.zenoh-version && format('release/{0}', inputs.zenoh-version) || '' }} GIT_USER_NAME: eclipse-zenoh-bot GIT_USER_EMAIL: eclipse-zenoh-bot@users.noreply.github.com diff --git a/.gitignore b/.gitignore index d7a6cf967..68a5929e8 100644 --- a/.gitignore +++ b/.gitignore @@ -70,4 +70,9 @@ dkms.conf .cache # Platform dependent generated files -include/zenoh_configure.h \ No newline at end of file +include/zenoh_configure.h + +# CMake +CMakeFiles/ +debug/ +release/ \ No newline at end of file diff --git a/ci/scripts/bump-and-tag.bash b/ci/scripts/bump-and-tag.bash index dcead5bc2..a8aafb00c 100644 --- a/ci/scripts/bump-and-tag.bash +++ b/ci/scripts/bump-and-tag.bash @@ -1,11 +1,11 @@ #!/usr/bin/env bash -set -eo pipefail +set -xeo pipefail # Release number readonly version=${VERSION:-''} # Dependencies' pattern -readonly bump_deps_pattern=${BUMP_DEPS_PATTERN:-input BUMP_DEPS_PATTERN is required} +readonly bump_deps_pattern=${BUMP_DEPS_PATTERN:-''} # Dependencies' version readonly bump_deps_version=${BUMP_DEPS_VERSION:-''} # Dependencies' git branch @@ -46,25 +46,27 @@ toml_set_in_place Cargo.toml.in "package.metadata.deb.variants.libzenohc-dev.dep git commit version.txt Cargo.toml Cargo.toml.in Cargo.lock -m "chore: Bump version to $version" # Select all package dependencies that match $bump_deps_pattern and bump them to $bump_deps_version -deps=$(toml get Cargo.toml dependencies | jq -r "keys.[] | select(test(\"$bump_deps_pattern\"))") -for dep in $deps; do - if [[ -n $bump_deps_version ]]; then - toml_set_in_place Cargo.toml "dependencies.$dep.version" "$bump_deps_version" - toml_set_in_place Cargo.toml.in "dependencies.$dep.version" "$bump_deps_version" - fi +if [[ "$bump_deps_pattern" != '' ]]; then + deps=$(toml get Cargo.toml dependencies | jq -r "keys.[] | select(test(\"$bump_deps_pattern\"))") + for dep in $deps; do + if [[ -n $bump_deps_version ]]; then + toml_set_in_place Cargo.toml "dependencies.$dep.version" "$bump_deps_version" + toml_set_in_place Cargo.toml.in "dependencies.$dep.version" "$bump_deps_version" + fi - if [[ -n $bump_deps_branch ]]; then - toml_set_in_place Cargo.toml "dependencies.$dep.branch" "$bump_deps_branch" - toml_set_in_place Cargo.toml.in "dependencies.$dep.branch" "$bump_deps_branch" - fi -done -# Update lockfile -cargo check + if [[ -n $bump_deps_branch ]]; then + toml_set_in_place Cargo.toml "dependencies.$dep.branch" "$bump_deps_branch" + toml_set_in_place Cargo.toml.in "dependencies.$dep.branch" "$bump_deps_branch" + fi + done + # Update lockfile + cargo check -if [[ -n $bump_deps_version || -n $bump_deps_branch ]]; then - git commit Cargo.toml Cargo.toml.in Cargo.lock -m "chore: Bump $bump_deps_pattern version to $bump_deps_version" -else - echo "info: no changes have been made to any dependencies" + if [[ -n $bump_deps_version || -n $bump_deps_branch ]]; then + git commit Cargo.toml Cargo.toml.in Cargo.lock -m "chore: Bump $bump_deps_pattern version to $bump_deps_version" + else + echo "warn: no changes have been made to any dependencies matching $bump_deps_pattern" + fi fi git tag "$version" -m "v$version"