From d38c494e0015e25a97c4eb1286a6562057a3e848 Mon Sep 17 00:00:00 2001 From: Pulumi Bot Date: Sat, 27 Sep 2025 06:51:03 +0000 Subject: [PATCH] [internal] Update GitHub Actions workflow files --- .ci-mgmt.yaml | 10 +-- .config/mise.lock | 55 ++++++++++++++ .config/mise.test.toml | 7 ++ .config/mise.toml | 26 +++++++ .github/actions/setup-tools/action.yml | 91 ----------------------- .github/workflows/build_provider.yml | 11 +-- .github/workflows/build_sdk.yml | 19 ++++- .github/workflows/copilot-setup-steps.yml | 9 ++- .github/workflows/license.yml | 10 ++- .github/workflows/main-post-build.yml | 18 ++++- .github/workflows/prerequisites.yml | 18 ++++- .github/workflows/publish.yml | 25 +++++-- .github/workflows/test.yml | 21 +++++- .github/workflows/verify-release.yml | 40 +++++++++- .gitignore | 4 + Makefile | 6 -- mise.toml | 19 ----- scripts/get-versions.sh | 50 +++++++++++++ scripts/plugins.mk | 24 +----- 19 files changed, 285 insertions(+), 178 deletions(-) create mode 100644 .config/mise.lock create mode 100644 .config/mise.test.toml create mode 100644 .config/mise.toml delete mode 100644 .github/actions/setup-tools/action.yml delete mode 100644 mise.toml create mode 100755 scripts/get-versions.sh diff --git a/.ci-mgmt.yaml b/.ci-mgmt.yaml index 34f78d30..1ed3eeda 100644 --- a/.ci-mgmt.yaml +++ b/.ci-mgmt.yaml @@ -6,10 +6,10 @@ team: ecosystem pulumiConvert: 1 registryDocs: true plugins: - - name: terraform - version: "1.0.16" - kind: converter + - name: terraform + version: "1.0.16" + kind: converter integrationTestProvider: true esc: - enabled: true - environment: imports/github-secrets # No repo-specific secrets. + enabled: true + environment: imports/github-secrets # No repo-specific secrets. diff --git a/.config/mise.lock b/.config/mise.lock new file mode 100644 index 00000000..1923a8be --- /dev/null +++ b/.config/mise.lock @@ -0,0 +1,55 @@ +[[tools.dotnet]] +version = "8.0.414" +backend = "asdf:dotnet" + +[[tools."github:pulumi/pulumictl"]] +version = "0.0.50" +backend = "github:pulumi/pulumictl" + +[tools."github:pulumi/pulumictl".platforms.linux-x64] +checksum = "blake3:c128dd74993f779c613296fe7cd21c20cbd323f24e59cb76e007620660b60348" +size = 27744219 +url = "https://github.com/pulumi/pulumictl/releases/download/v0.0.50/pulumictl-v0.0.50-linux-amd64.tar.gz" + +[[tools."github:pulumi/schema-tools"]] +version = "0.6.0" +backend = "github:pulumi/schema-tools" + +[tools."github:pulumi/schema-tools".platforms.linux-x64] +checksum = "blake3:82dfe616fee18b4258f6e3d2dc3c4e9f14afd43a0a4cc33eff2d2a04088d6ca3" +size = 14282746 +url = "https://github.com/pulumi/schema-tools/releases/download/v0.6.0/schema-tools-v0.6.0-linux-amd64.tar.gz" + +[[tools.go]] +version = "1.24.6" +backend = "core:go" + +[tools.go.platforms.linux-x64] +checksum = "sha256:bbca37cc395c974ffa4893ee35819ad23ebb27426df87af92e93a9ec66ef8712" +size = 78583176 +url = "https://dl.google.com/go/go1.24.6.linux-amd64.tar.gz" + +[[tools.gradle]] +version = "7.6.6" +backend = "aqua:gradle/gradle" + +[[tools.java]] +version = "corretto-11.0.28.6.1" +backend = "core:java" + +[[tools.node]] +version = "20.19.5" +backend = "core:node" + +[[tools.pulumi]] +version = "3.190.0" +backend = "aqua:pulumi/pulumi" + +[tools.pulumi.platforms.linux-x64] +checksum = "sha512:1847aaa3c3c0202cff9cbd3f547c5965abb2b2f83199b47c36c23121d7c860662b6d817226709fc3eadd24551a30ab656699d2eb992d2085bb90db6c195c2379" +size = 92837374 +url = "https://github.com/pulumi/pulumi/releases/download/v3.190.0/pulumi-v3.190.0-linux-x64.tar.gz" + +[[tools.python]] +version = "3.11.8" +backend = "core:python" diff --git a/.config/mise.test.toml b/.config/mise.test.toml new file mode 100644 index 00000000..ce00eb57 --- /dev/null +++ b/.config/mise.test.toml @@ -0,0 +1,7 @@ +# WARNING: This file is autogenerated - changes will be overwritten when regenerated by https://github.com/pulumi/ci-mgmt + +# Overrides tool versions for test workflows + +[tools] +# always use pulumi latest for tests +pulumi = "latest" diff --git a/.config/mise.toml b/.config/mise.toml new file mode 100644 index 00000000..b22a30ea --- /dev/null +++ b/.config/mise.toml @@ -0,0 +1,26 @@ +# WARNING: This file is autogenerated - changes will be overwritten when regenerated by https://github.com/pulumi/ci-mgmt +# You can create your own root-level mise.toml file to override/augment this. See https://mise.jdx.dev/configuration.html + +[env] +_.source = "{{config_root}}/scripts/get-versions.sh" + +[tools] + +# Runtimes +# TODO: we may not need `get_env` once https://github.com/jdx/mise/discussions/6339 is fixed +go = "{{ get_env(name='GO_VERSION', default='latest') }}" +node = '20' +python = '3.11.8' +dotnet = '8.0' +# Corretto version used as Java SE/OpenJDK version no longer offered +java = 'corretto-11' + +# Executable tools +pulumi = "{{ get_env(name='PULUMI_VERSION', default='latest') }}" +"github:pulumi/pulumictl" = 'latest' +"github:pulumi/schema-tools" = "latest" +gradle = '7.6' + +[settings] +experimental = true # Required for Go binaries (e.g. pulumictl). +lockfile = true diff --git a/.github/actions/setup-tools/action.yml b/.github/actions/setup-tools/action.yml deleted file mode 100644 index d6b19546..00000000 --- a/.github/actions/setup-tools/action.yml +++ /dev/null @@ -1,91 +0,0 @@ -name: Setup tools -description: Installs Go, Pulumi, pulumictl, schema-tools, Node.JS, Python, dotnet and Java. - -inputs: - tools: - description: | - Comma separated list of tools to install. The default of "all" installs all tools. Available tools are: - go - pulumicli - pulumictl - schema-tools - nodejs - python - dotnet - java - default: all - cache-go: - description: | - Whether to enable the GitHub cache for Go. Appropriate for disabling in - smaller jobs that typically completely before the "real" job has an - opportunity to populate the cache. - default: "true" - -runs: - using: "composite" - steps: - - name: Install Go - if: inputs.tools == 'all' || contains(inputs.tools, 'go') - uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5 - with: - go-version: "1.21.x" - cache-dependency-path: | - provider/*.sum - upstream/*.sum - sdk/go/*.sum - sdk/*.sum - *.sum - # TODO(https://github.com/actions/setup-go/issues/316): Restore but don't save the cache. - cache: ${{ inputs.cache-go }} - - - name: Install pulumictl - if: inputs.tools == 'all' || contains(inputs.tools, 'pulumictl') - uses: jaxxstorm/action-install-gh-release@6096f2a2bbfee498ced520b6922ac2c06e990ed2 # v2.1.0 - with: - tag: v0.0.46 - repo: pulumi/pulumictl - - - name: Install Pulumi CLI - if: inputs.tools == 'all' || contains(inputs.tools, 'pulumicli') - uses: pulumi/actions@cc7494be991dba0978f7ffafaf995b0449a0998e # v6 - with: - pulumi-version: "dev" - - - name: Install Schema Tools - if: inputs.tools == 'all' || contains(inputs.tools, 'schema-tools') - uses: jaxxstorm/action-install-gh-release@6096f2a2bbfee498ced520b6922ac2c06e990ed2 # v2.1.0 - with: - repo: pulumi/schema-tools - - - name: Setup Node - if: inputs.tools == 'all' || contains(inputs.tools, 'nodejs') - uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5 - with: - node-version: 20.x - registry-url: https://registry.npmjs.org - - - name: Setup DotNet - if: inputs.tools == 'all' || contains(inputs.tools, 'dotnet') - uses: actions/setup-dotnet@d4c94342e560b34958eacfc5d055d21461ed1c5d # v5.0.0 - with: - dotnet-version: 8.0.x - - - name: Setup Python - if: inputs.tools == 'all' || contains(inputs.tools, 'python') - uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 - with: - python-version: 3.11.8 - - - name: Setup Java - if: inputs.tools == 'all' || contains(inputs.tools, 'java') - uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0 - with: - cache: gradle - distribution: temurin - java-version: 11 - - - name: Setup Gradle - if: inputs.tools == 'all' || contains(inputs.tools, 'java') - uses: gradle/actions/setup-gradle@ed408507eac070d1f99cc633dbcf757c94c7933a # v4.4.3 - with: - gradle-version: 7.6 diff --git a/.github/workflows/build_provider.yml b/.github/workflows/build_provider.yml index d9406067..38bb5867 100644 --- a/.github/workflows/build_provider.yml +++ b/.github/workflows/build_provider.yml @@ -56,12 +56,13 @@ jobs: - uses: MOZGIII/install-ldid-action@v1 with: tag: v2.1.5-procursus2 - - name: Setup tools - uses: ./.github/actions/setup-tools + - name: Setup mise + uses: jdx/mise-action@v3 with: - tools: pulumictl, go - # use per-platform/arch caches instead since we are doing cross-builds - cache-go: false + github_token: ${{ secrets.GITHUB_TOKEN }} + cache_key: "mise-{{platform}}-{{file_hash}}" + # only saving the cache in the prerequisites job + cache_save: false # Based on https://github.com/actions/cache/blob/main/examples.md#go---modules - name: Get GOCACHE id: gocache diff --git a/.github/workflows/build_sdk.yml b/.github/workflows/build_sdk.yml index 83e66b66..7024abbf 100644 --- a/.github/workflows/build_sdk.yml +++ b/.github/workflows/build_sdk.yml @@ -54,10 +54,23 @@ jobs: path: | .pulumi/examples-cache key: ${{ runner.os }}-${{ hashFiles('provider/go.sum') }} - - name: Setup tools - uses: ./.github/actions/setup-tools + - name: Setup mise + uses: jdx/mise-action@v3 with: - tools: pulumictl, pulumicli, ${{ matrix.language }} + github_token: ${{ secrets.GITHUB_TOKEN }} + cache_key: "mise-{{platform}}-{{file_hash}}" + # only saving the cache in the prerequisites job + cache_save: false + - name: Setup Go Cache + if: matrix.language == 'go' || contains(matrix.language, 'go') + uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5 + with: + cache-dependency-path: | + provider/*.sum + upstream/*.sum + sdk/go/*.sum + sdk/*.sum + *.sum - name: Prepare local workspace run: make prepare_local_workspace env: diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml index 38fc1666..acede537 100644 --- a/.github/workflows/copilot-setup-steps.yml +++ b/.github/workflows/copilot-setup-steps.yml @@ -32,10 +32,13 @@ jobs: with: persist-credentials: false - - name: Setup tools - uses: ./.github/actions/setup-tools + - name: Setup mise + uses: jdx/mise-action@v3 with: - tools: pulumictl, pulumicli, nodejs, python, dotnet, go, java + github_token: ${{ secrets.GITHUB_TOKEN }} + cache_key: "mise-{{platform}}-{{file_hash}}" + # only saving the cache in the prerequisites job + cache_save: false - name: Prepare local workspace # this runs install_plugins and upstream diff --git a/.github/workflows/license.yml b/.github/workflows/license.yml index 876de803..9ca0800f 100644 --- a/.github/workflows/license.yml +++ b/.github/workflows/license.yml @@ -21,11 +21,13 @@ jobs: uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: persist-credentials: false - - name: Setup tools - uses: ./.github/actions/setup-tools + - name: Setup mise + uses: jdx/mise-action@v3 with: - tools: go - cache-go: false + github_token: ${{ secrets.GITHUB_TOKEN }} + cache_key: "mise-{{platform}}-{{file_hash}}" + # only saving the cache in the prerequisites job + cache_save: false - run: make prepare_local_workspace continue-on-error: true env: diff --git a/.github/workflows/main-post-build.yml b/.github/workflows/main-post-build.yml index 5b5fc67b..8df26e3a 100644 --- a/.github/workflows/main-post-build.yml +++ b/.github/workflows/main-post-build.yml @@ -48,10 +48,22 @@ jobs: aws-access-key-id: ${{ steps.esc-secrets.outputs.AWS_CORP_S3_UPLOAD_ACCESS_KEY_ID }} aws-region: us-west-2 aws-secret-access-key: ${{ steps.esc-secrets.outputs.AWS_CORP_S3_UPLOAD_SECRET_ACCESS_KEY }} - - name: Setup tools - uses: ./.github/actions/setup-tools + - name: Setup mise + uses: jdx/mise-action@v3 with: - tools: pulumictl, pulumicli, go, schema-tools + github_token: ${{ secrets.GITHUB_TOKEN }} + cache_key: "mise-{{platform}}-{{file_hash}}" + # only saving the cache in the prerequisites job + cache_save: false + - name: Setup Go Cache + uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5 + with: + cache-dependency-path: | + provider/*.sum + upstream/*.sum + sdk/go/*.sum + sdk/*.sum + *.sum - name: Echo Coverage Output Dir run: 'echo "Coverage output directory: ${{ env.COVERAGE_OUTPUT_DIR }}"' - name: Generate Coverage Data diff --git a/.github/workflows/prerequisites.yml b/.github/workflows/prerequisites.yml index 19c5c082..51994591 100644 --- a/.github/workflows/prerequisites.yml +++ b/.github/workflows/prerequisites.yml @@ -60,10 +60,22 @@ jobs: path: | .pulumi/examples-cache key: ${{ runner.os }}-${{ hashFiles('provider/go.sum') }} - - name: Setup tools - uses: ./.github/actions/setup-tools + - name: Setup mise + uses: jdx/mise-action@v3 with: - tools: go, pulumictl, pulumicli, schema-tools + github_token: ${{ secrets.GITHUB_TOKEN }} + cache_key: "mise-{{platform}}-{{file_hash}}" + # only saving the cache in the prerequisites job + cache_save: true + - name: Setup Go Cache + uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5 + with: + cache-dependency-path: | + provider/*.sum + upstream/*.sum + sdk/go/*.sum + sdk/*.sum + *.sum - name: Prepare local workspace before restoring previously built files run: make prepare_local_workspace env: diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index f47956ef..105b06f2 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -50,11 +50,12 @@ jobs: id: esc-secrets name: Fetch secrets from ESC uses: pulumi/esc-action@9eb774255b1a4afb7855678ae8d4a77359da0d9b - - name: Setup tools - uses: ./.github/actions/setup-tools + - name: Setup mise + uses: jdx/mise-action@v3 with: - tools: pulumictl, pulumicli, go, schema-tools - cache-go: false + github_token: ${{ secrets.GITHUB_TOKEN }} + cache_key: "mise-{{platform}}-${{ hashFiles('mise.lock') }}" + cache_save: false - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@a03048d87541d1d9fcf2ecf528a4a65ba9bd7838 # v5.0.0 with: @@ -135,11 +136,19 @@ jobs: id: esc-secrets name: Fetch secrets from ESC uses: pulumi/esc-action@9eb774255b1a4afb7855678ae8d4a77359da0d9b - - name: Setup tools - uses: ./.github/actions/setup-tools + - name: Setup mise + uses: jdx/mise-action@v3 with: - tools: pulumictl, pulumicli, nodejs, python, dotnet, go, java - cache-go: false + github_token: ${{ secrets.GITHUB_TOKEN }} + cache_key: "mise-{{platform}}-{{file_hash}}" + # only saving the cache in the prerequisites job + cache_save: false + - name: Setup Node + uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5 + with: + # we don't set node-version because we install with mise. + # this step is needed to setup npm auth + registry-url: https://registry.npmjs.org - name: Publish SDKs if: inputs.skipJavaSdk == false uses: pulumi/pulumi-package-publisher@c1672c7928591d563dccb12729e05e315c21f8c2 # v0.0.22 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2fbf32a9..3c270c84 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -46,16 +46,31 @@ jobs: with: repository: pulumi/examples path: p-examples - - name: Setup tools - uses: ./.github/actions/setup-tools + - name: Setup mise + uses: jdx/mise-action@v3 + env: + MISE_ENV: test with: - tools: pulumictl, pulumicli, ${{ matrix.language }} + github_token: ${{ secrets.GITHUB_TOKEN }} + cache_key: "mise-{{platform}}-{{file_hash}}" + # also save this cache since we are using a different mise env. + cache_save: true - name: Prepare local workspace run: make prepare_local_workspace env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Download bin uses: ./.github/actions/download-provider + - name: Setup Go Cache + uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5 + if: matrix.language == 'go' || contains(matrix.language, 'go') + with: + cache-dependency-path: | + provider/*.sum + upstream/*.sum + sdk/go/*.sum + sdk/*.sum + *.sum - name: Download SDK uses: ./.github/actions/download-sdk with: diff --git a/.github/workflows/verify-release.yml b/.github/workflows/verify-release.yml index df864c17..482227d0 100644 --- a/.github/workflows/verify-release.yml +++ b/.github/workflows/verify-release.yml @@ -74,7 +74,41 @@ jobs: id: esc-secrets name: Fetch secrets from ESC uses: pulumi/esc-action@9eb774255b1a4afb7855678ae8d4a77359da0d9b - - name: Setup tools - uses: ./.github/actions/setup-tools + - name: Setup Python + uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 with: - tools: pulumicli, nodejs, python, dotnet, go, java + python-version: 3.11.8 + - name: Setup Java + uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0 + with: + cache: gradle + distribution: temurin + java-version: 11 + - name: Setup Gradle + uses: gradle/actions/setup-gradle@ed408507eac070d1f99cc633dbcf757c94c7933a # v4.4.3 + with: + gradle-version: 7.6 + - name: Setup DotNet + uses: actions/setup-dotnet@d4c94342e560b34958eacfc5d055d21461ed1c5d # v5.0.0 + with: + dotnet-version: 8.0.x + - name: Setup Node + uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5 + with: + node-version: 20.x + registry-url: https://registry.npmjs.org + - name: Install Go + uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5 + with: + go-version: "1.21.x" + cache-dependency-path: | + provider/*.sum + upstream/*.sum + sdk/go/*.sum + sdk/*.sum + *.sum + cache: true + - name: Install Pulumi CLI + uses: pulumi/actions@cc7494be991dba0978f7ffafaf995b0449a0998e # v6 + with: + pulumi-version: "dev" diff --git a/.gitignore b/.gitignore index bd276018..04373b79 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,7 @@ sdk/python/venv # Ignore local build tracking directory .make + + +# Ignore local mise config +mise.local.toml diff --git a/Makefile b/Makefile index b85ed701..6f68053b 100644 --- a/Makefile +++ b/Makefile @@ -97,7 +97,6 @@ GEN_ENVS := PULUMI_HOME=$(GEN_PULUMI_HOME) PULUMI_CONVERT_EXAMPLES_CACHE_DIR=$(G generate_dotnet: .make/generate_dotnet build_dotnet: .make/build_dotnet -.make/generate_dotnet: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) .make/generate_dotnet: .make/install_plugins bin/$(CODEGEN) $(GEN_ENVS) $(WORKING_DIR)/bin/$(CODEGEN) dotnet --out sdk/dotnet/ cd sdk/dotnet/ && \ @@ -111,7 +110,6 @@ build_dotnet: .make/build_dotnet generate_go: .make/generate_go build_go: .make/build_go -.make/generate_go: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) .make/generate_go: .make/install_plugins bin/$(CODEGEN) $(GEN_ENVS) $(WORKING_DIR)/bin/$(CODEGEN) go --out sdk/go/ @touch $@ @@ -122,7 +120,6 @@ build_go: .make/build_go generate_java: .make/generate_java build_java: .make/build_java -.make/generate_java: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) .make/generate_java: PACKAGE_VERSION := $(PROVIDER_VERSION) .make/generate_java: .make/install_plugins bin/$(CODEGEN) $(GEN_ENVS) $(WORKING_DIR)/bin/$(CODEGEN) java --out sdk/java/ @@ -138,7 +135,6 @@ build_java: .make/build_java generate_nodejs: .make/generate_nodejs build_nodejs: .make/build_nodejs -.make/generate_nodejs: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) .make/generate_nodejs: .make/install_plugins bin/$(CODEGEN) $(GEN_ENVS) $(WORKING_DIR)/bin/$(CODEGEN) nodejs --out sdk/nodejs/ printf "module fake_nodejs_module // Exclude this directory from Go tools\n\ngo 1.17\n" > sdk/nodejs/go.mod @@ -153,7 +149,6 @@ build_nodejs: .make/build_nodejs generate_python: .make/generate_python build_python: .make/build_python -.make/generate_python: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) .make/generate_python: .make/install_plugins bin/$(CODEGEN) $(GEN_ENVS) $(WORKING_DIR)/bin/$(CODEGEN) python --out sdk/python/ printf "module fake_python_module // Exclude this directory from Go tools\n\ngo 1.17\n" > sdk/python/go.mod @@ -240,7 +235,6 @@ schema: .make/schema # This does actually have dependencies, but we're keeping it around for backwards compatibility for now tfgen_no_deps: .make/schema .make/schema: export PULUMI_HOME := $(WORKING_DIR)/.pulumi -.make/schema: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) .make/schema: export PULUMI_CONVERT := $(PULUMI_CONVERT) .make/schema: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache .make/schema: export PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION := $(PULUMI_CONVERT) diff --git a/mise.toml b/mise.toml deleted file mode 100644 index 630a5930..00000000 --- a/mise.toml +++ /dev/null @@ -1,19 +0,0 @@ -# WARNING: This file is autogenerated - changes will be overwritten when regenerated by https://github.com/pulumi/ci-mgmt - -[tools] - -# Runtimes -go = '1.21' -node = '20' -python = '3.11.8' -dotnet = '8.0' -# Corretto version used as Java SE/OpenJDK version no longer offered -java = 'corretto-11' - -# Executable tools -pulumi = 'latest' -"go:github.com/pulumi/pulumictl/cmd/pulumictl" = 'latest' -gradle = '7.6' - -[settings] -experimental = true # Required for Go binaries (e.g. pulumictl). diff --git a/scripts/get-versions.sh b/scripts/get-versions.sh new file mode 100755 index 00000000..c557e55e --- /dev/null +++ b/scripts/get-versions.sh @@ -0,0 +1,50 @@ +#!/usr/bin/env bash +set -euo pipefail + +# This script can be simplified to use go when https://github.com/jdx/mise/discussions/6374 is fixed +# e.g. go list -m -f '{{.GoVersion}}' + +module_path="github.com/pulumi/pulumi/pkg/v3" +gomod="provider/go.mod" + +if [[ ! -f "$gomod" ]]; then + echo "missing $gomod" >&2 + exit 1 +fi + +raw_version=$(awk -v module="$module_path" ' + $1 == module || $2 == module { + for (i = 1; i <= NF; i++) { + if ($i ~ /^v[0-9]/) { + sub(/^v/, "", $i) + print $i + exit + } + } + } +' "$gomod") + +if [[ -z "${raw_version:-}" ]]; then + echo "failed to determine Pulumi version from $gomod" >&2 + exit 1 +fi + +echo "PULUMI_VERSION=$raw_version" +export PULUMI_VERSION=$raw_version + +# Prefer the toolchain directive if present, otherwise fall back to the `go` version line +go_toolchain=$(awk '/^toolchain[[:space:]]+go[0-9]/{ print $2; exit }' "$gomod") + +if [[ -n "${go_toolchain:-}" ]]; then + go_version=${go_toolchain#go} +else + go_version=$(awk '/^go[[:space:]]+[0-9]/{ print $2; exit }' "$gomod") +fi + +if [[ -z "${go_version:-}" ]]; then + echo "failed to determine Go version from $gomod" >&2 + exit 1 +fi + +echo "GO_VERSION=$go_version" +export GO_VERSION=$go_version diff --git a/scripts/plugins.mk b/scripts/plugins.mk index 64a0222d..d6351755 100644 --- a/scripts/plugins.mk +++ b/scripts/plugins.mk @@ -1,27 +1,7 @@ # Install Pulumi and plugins required at build time. install_plugins: .make/install_plugins .make/install_plugins: export PULUMI_HOME := $(WORKING_DIR)/.pulumi -.make/install_plugins: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) -.make/install_plugins: .pulumi/bin/pulumi - .pulumi/bin/pulumi plugin install converter terraform 1.0.16 +.make/install_plugins: + pulumi plugin install converter terraform 1.0.16 @touch $@ .PHONY: install_plugins - -# Because some codegen depends on the version of the CLI used, we install a local CLI -# version pinned to the same version as the 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 - @if [ -x .pulumi/bin/pulumi ] && [ "v$$(cat .pulumi/version)" = "$$(.pulumi/bin/pulumi version)" ]; then \ - echo "pulumi/bin/pulumi version: v$$(cat .pulumi/version)"; \ - touch $@; \ - 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 - (cd provider && go list -f "{{slice .Version 1}}" -m github.com/pulumi/pulumi/pkg/v3) | tee $@