diff --git a/.github/workflows/update-bridge.yml b/.github/workflows/update-bridge.yml deleted file mode 100644 index 17287db6..00000000 --- a/.github/workflows/update-bridge.yml +++ /dev/null @@ -1,91 +0,0 @@ -# WARNING: This file is autogenerated - changes will be overwritten if not made via https://github.com/pulumi/ci-mgmt - -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - PULUMI_EXTRA_MAPPING_ERROR: false - PULUMI_MISSING_MAPPING_ERROR: false -jobs: - update_bridge: - name: update-bridge - runs-on: ubuntu-latest - steps: - - name: Checkout Repo - uses: actions/checkout@v3 - - name: Unshallow clone for tags - run: git fetch --prune --unshallow --tags - - name: Install Go - uses: actions/setup-go@v4 - with: - cache-dependency-path: | - sdk/go.sum - go-version: 1.21.x - - name: Install pulumictl - uses: jaxxstorm/action-install-gh-release@v1.5.0 - with: - repo: pulumi/pulumictl - - name: Install Pulumi CLI - uses: pulumi/action-install-pulumi-cli@v2 - - name: Setup DotNet - uses: actions/setup-dotnet@v1 - with: - dotnet-version: ${{ env.DOTNETVERSION }} - - name: Setup Node - uses: actions/setup-node@v2 - with: - node-version: ${{ env.NODEVERSION }} - registry-url: https://registry.npmjs.org - - name: Setup Python - uses: actions/setup-python@v2 - with: - python-version: ${{ env.PYTHONVERSION }} - - name: Update pulumi-terraform-bridge - run: cd provider && go mod edit -require - github.com/pulumi/pulumi-terraform-bridge/v3@v${{ - github.event.inputs.bridge_version }} && go mod tidy - - name: Update Pulumi SDK (provider/go.mod) - run: cd provider && go mod edit -require github.com/pulumi/pulumi/sdk/v3@v${{ - github.event.inputs.sdk_version }} && go mod tidy - - name: Update Pulumi SDK (sdk/go.mod) - run: cd sdk && go mod edit -require github.com/pulumi/pulumi/sdk/v3@v${{ - github.event.inputs.sdk_version }} && go mod tidy - - run: make tfgen - - run: make build_sdks - - id: create-pr - name: Create PR - uses: peter-evans/create-pull-request@v3.12.0 - with: - author: pulumi-bot - base: master - body: This pull request was generated automatically by the update-bridge - workflow in this repository. - branch: pulumi-bot/bridge-v${{ github.event.inputs.bridge_version }}-${{ - github.run_id}} - commit-message: Update pulumi-terraform-bridge to v${{ - github.event.inputs.bridge_version }} - committer: pulumi-bot - labels: impact/no-changelog-required - team-reviewers: platform-integrations - title: Update pulumi-terraform-bridge to v${{ github.event.inputs.bridge_version }} - token: ${{ secrets.PULUMI_BOT_TOKEN }} - - if: steps.create-pr.outputs.pull-request-operation == 'created' && - github.event.inputs.automerge == 'true' - run: gh pr merge --auto --squash ${{ steps.create-pr.outputs.pull-request-number }} -name: Update pulumi-terraform-bridge -on: - workflow_dispatch: - inputs: - automerge: - default: false - description: Mark created PR for auto-merging? - required: true - type: boolean - bridge_version: - description: The version of pulumi/pulumi-terraform-bridge to update to. Do not - include the 'v' prefix. Must be major version 3. - required: true - type: string - sdk_version: - description: The version of pulumi/pulumi/sdk to update to. Do not include the - 'v' prefix. Must be major version 3. - required: true - type: string diff --git a/Makefile b/Makefile index a5b13fad..1b84bd1f 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,7 @@ JAVA_GEN := pulumi-java-gen JAVA_GEN_VERSION := v0.5.4 TESTPARALLELISM := 10 WORKING_DIR := $(shell pwd) +PULUMI_CONVERT := 0 development: install_plugins provider build_sdks install_sdks @@ -93,8 +94,7 @@ install_dotnet_sdk: install_nodejs_sdk: yarn link --cwd $(WORKING_DIR)/sdk/nodejs/bin -install_plugins: - [ -x "$(shell command -v pulumi 2>/dev/null)" ] || curl -fsSL https://get.pulumi.com | sh +install_plugins: .pulumi/bin/pulumi lint_provider: provider cd provider && golangci-lint run -c ../.golangci.yml @@ -107,7 +107,7 @@ test: tfgen: install_plugins upstream (cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(TFGEN) -ldflags "-X $(PROJECT)/$(VERSION_PATH)=$(VERSION)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(TFGEN)) - $(WORKING_DIR)/bin/$(TFGEN) schema --out provider/cmd/$(PROVIDER) + PATH=${PWD}/.pulumi/bin:$$PATH PULUMI_CONVERT=$(PULUMI_CONVERT) $(WORKING_DIR)/bin/$(TFGEN) schema --out provider/cmd/$(PROVIDER) (cd provider && VERSION=$(VERSION) go generate cmd/$(PROVIDER)/main.go) upstream: @@ -137,5 +137,13 @@ ci-mgmt: .ci-mgmt.yaml --template bridged-provider \ --config $< +.pulumi/bin/pulumi: HOME := $(WORKING_DIR) +.pulumi/bin/pulumi: .pulumi/version + curl -fsSL https://get.pulumi.com | sh -s -- --version $(cat .pulumi/version) + +# Compute the version of Pulumi to use by inspecting the Go dependencies of the provider. +.pulumi/version: + @mkdir -p .pulumi + @cd provider && go list -f "{{slice .Version 1}}" -m github.com/pulumi/pulumi/pkg/v3 | tee ../$@ .PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_dotnet build_go build_java build_nodejs build_python clean cleanup help install_dotnet_sdk install_nodejs_sdk install_plugins lint_provider provider test tfgen upstream upstream.finalize upstream.rebase ci-mgmt