From 8516f4241b0d0f93992bcfc93d5e3de68f9b1898 Mon Sep 17 00:00:00 2001 From: Colin Casey Date: Tue, 12 Sep 2023 11:38:39 -0300 Subject: [PATCH] Keep `libcnb-cargo` and `libcnb-package` versions in sync (#135) * Keep `libcnb.rs` tools in sync Because the languages CLI tooling depends on `libcnb-package` to determine build information, this should be kept in sync with the version of `libcnb-cargo` installed in the `_buildpacks-release.yml` workflow so that we can be sure that behavior of the `libcnb.rs` tooling is consistent. --- .github/workflows/_buildpacks-release.yml | 12 +++++++++--- Cargo.toml | 1 - 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/_buildpacks-release.yml b/.github/workflows/_buildpacks-release.yml index 16230981..51af59e2 100644 --- a/.github/workflows/_buildpacks-release.yml +++ b/.github/workflows/_buildpacks-release.yml @@ -75,10 +75,16 @@ jobs: - name: Rust cache uses: Swatinem/rust-cache@v2.6.2 + # the version of `libcnb-cargo` installed here is kept in sync with the version of `libcnb-package` + # that the release automation CLI tooling depends on - name: Install libcnb-cargo - # TODO: Derive this version from the `libcnb-package` version in this repo's `Cargo.toml`, - # or at least add a CI check to ensure the two versions are in sync. - run: cargo install --locked libcnb-cargo@0.13.0 + run: | + LOCKFILE_URL="https://raw.githubusercontent.com/heroku/languages-github-actions/${{ inputs.languages_cli_branch }}/Cargo.lock" + LIBCNB_PACKAGE_VERSION=$( \ + curl --silent --show-error --fail --retry 5 --retry-all-errors --connect-timeout 10 --max-time 60 "${LOCKFILE_URL}" \ + | yq -ptoml -oyaml '.package[] | select(.name == "libcnb-package") | .version' \ + ) + cargo install --locked "libcnb-cargo@${LIBCNB_PACKAGE_VERSION}" - name: Install Languages CLI uses: heroku/languages-github-actions/.github/actions/install-languages-cli@main diff --git a/Cargo.toml b/Cargo.toml index dfb9cae7..ca7a7813 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,7 +25,6 @@ clap = { version = "4", default-features = false, features = [ ] } indexmap = "2" lazy_static = "1" -# NB: Make sure to keep the `libcnb-cargo` version in `_buildpacks-release.yml` in sync with these. libcnb-data = "=0.13.0" libcnb-package = "=0.13.0" markdown = "1.0.0-alpha.12"