From 0c922ca4b6d1f63dee5e78d260c99c57f5b276b2 Mon Sep 17 00:00:00 2001 From: Pulumi Bot <30351955+pulumi-bot@users.noreply.github.com> Date: Mon, 22 Jul 2024 22:56:20 -0700 Subject: [PATCH] [internal] Update GitHub Actions workflow files (#241) --- Makefile | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 574e78d..63b4804 100644 --- a/Makefile +++ b/Makefile @@ -182,8 +182,19 @@ ci-mgmt: .ci-mgmt.yaml --template bridged-provider \ --config $< +# Because some codegen depends on the version of the CLI used, we install a local CLI +# version pinned to the same version as `provider/go.mod`. +# +# This logic compares the version of .pulumi/bin/pulumi already installed. If it matches +# the desired version, we just print. Otherwise we (re)install pulumi at the desired +# version. .pulumi/bin/pulumi: .pulumi/version - curl -fsSL https://get.pulumi.com | HOME=$(WORKING_DIR) sh -s -- --version $(shell cat .pulumi/version) + @if [ -x .pulumi/bin/pulumi ] && [ "v$$(cat .pulumi/version)" = "$$(.pulumi/bin/pulumi version)" ]; then \ + echo "pulumi/bin/pulumi version: v$$(cat .pulumi/version)"; \ + else \ + curl -fsSL https://get.pulumi.com | \ + HOME=$(WORKING_DIR) sh -s -- --version "$$(cat .pulumi/version)"; \ + fi # Compute the version of Pulumi to use by inspecting the Go dependencies of the provider. .pulumi/version: provider/go.mod