From 9b49a649d1aaf0e4f9a3f97b406dd3bf90b16b9a Mon Sep 17 00:00:00 2001 From: Pulumi Bot Date: Fri, 6 Oct 2023 06:44:22 +0000 Subject: [PATCH] [internal] Update GitHub Actions workflow files --- .ci-mgmt.yaml | 8 ++ .github/workflows/command-dispatch.yml | 2 +- .github/workflows/lint.yml | 2 +- .github/workflows/master.yml | 2 +- .github/workflows/prerelease.yml | 2 +- .github/workflows/pull-request.yml | 2 +- .github/workflows/release.yml | 2 +- .github/workflows/resync-build.yml | 2 +- .github/workflows/run-acceptance-tests.yml | 2 +- .github/workflows/update-bridge.yml | 91 ---------------------- .github/workflows/upgrade-provider.yml | 2 +- Makefile | 30 ++++++- 12 files changed, 43 insertions(+), 104 deletions(-) create mode 100644 .ci-mgmt.yaml delete mode 100644 .github/workflows/update-bridge.yml diff --git a/.ci-mgmt.yaml b/.ci-mgmt.yaml new file mode 100644 index 00000000..e3596e2c --- /dev/null +++ b/.ci-mgmt.yaml @@ -0,0 +1,8 @@ +provider: wavefront +major-version: 3 +env: + WAVEFRONT_ADDRESS: ${{ secrets.WAVEFRONT_ADDRESS }} + WAVEFRONT_TOKEN: ${{ secrets.WAVEFRONT_TOKEN }} +makeTemplate: bridged +team: ecosystem +javaGenVersion: "v0.9.5" diff --git a/.github/workflows/command-dispatch.yml b/.github/workflows/command-dispatch.yml index 5dc7b93f..3148e51b 100644 --- a/.github/workflows/command-dispatch.yml +++ b/.github/workflows/command-dispatch.yml @@ -9,7 +9,7 @@ env: GOVERSION: 1.21.x JAVAVERSION: "11" NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - NODEVERSION: 16.x + NODEVERSION: 20.x NPM_TOKEN: ${{ secrets.NPM_TOKEN }} NUGET_PUBLISH_KEY: ${{ secrets.NUGET_PUBLISH_KEY }} PUBLISH_REPO_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 7f34accb..5b6425ec 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -14,7 +14,7 @@ env: GOVERSION: 1.21.x JAVAVERSION: "11" NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - NODEVERSION: 16.x + NODEVERSION: 20.x NPM_TOKEN: ${{ secrets.NPM_TOKEN }} NUGET_PUBLISH_KEY: ${{ secrets.NUGET_PUBLISH_KEY }} PUBLISH_REPO_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 4d551baf..10eea066 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -9,7 +9,7 @@ env: GOVERSION: 1.21.x JAVAVERSION: "11" NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - NODEVERSION: 16.x + NODEVERSION: 20.x NPM_TOKEN: ${{ secrets.NPM_TOKEN }} NUGET_PUBLISH_KEY: ${{ secrets.NUGET_PUBLISH_KEY }} PUBLISH_REPO_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index d6eaaa6e..86d5bf6e 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -10,7 +10,7 @@ env: GOVERSION: 1.21.x JAVAVERSION: "11" NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - NODEVERSION: 16.x + NODEVERSION: 20.x NPM_TOKEN: ${{ secrets.NPM_TOKEN }} NUGET_PUBLISH_KEY: ${{ secrets.NUGET_PUBLISH_KEY }} PUBLISH_REPO_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index d5d43a25..fa89cfb9 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -9,7 +9,7 @@ env: GOVERSION: 1.21.x JAVAVERSION: "11" NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - NODEVERSION: 16.x + NODEVERSION: 20.x NPM_TOKEN: ${{ secrets.NPM_TOKEN }} NUGET_PUBLISH_KEY: ${{ secrets.NUGET_PUBLISH_KEY }} PUBLISH_REPO_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 68eb19c7..1fa9ce6a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,7 +9,7 @@ env: GOVERSION: 1.21.x JAVAVERSION: "11" NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - NODEVERSION: 16.x + NODEVERSION: 20.x NPM_TOKEN: ${{ secrets.NPM_TOKEN }} NUGET_PUBLISH_KEY: ${{ secrets.NUGET_PUBLISH_KEY }} PUBLISH_REPO_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} diff --git a/.github/workflows/resync-build.yml b/.github/workflows/resync-build.yml index fe5139e6..4a278d52 100644 --- a/.github/workflows/resync-build.yml +++ b/.github/workflows/resync-build.yml @@ -11,7 +11,7 @@ env: GOVERSION: 1.21.x JAVAVERSION: "11" NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - NODEVERSION: 16.x + NODEVERSION: 20.x NPM_TOKEN: ${{ secrets.NPM_TOKEN }} NUGET_PUBLISH_KEY: ${{ secrets.NUGET_PUBLISH_KEY }} PUBLISH_REPO_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} diff --git a/.github/workflows/run-acceptance-tests.yml b/.github/workflows/run-acceptance-tests.yml index 3dd1f0be..c1b2a5b4 100644 --- a/.github/workflows/run-acceptance-tests.yml +++ b/.github/workflows/run-acceptance-tests.yml @@ -10,7 +10,7 @@ env: GOVERSION: 1.21.x JAVAVERSION: "11" NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - NODEVERSION: 16.x + NODEVERSION: 20.x NPM_TOKEN: ${{ secrets.NPM_TOKEN }} NUGET_PUBLISH_KEY: ${{ secrets.NUGET_PUBLISH_KEY }} PUBLISH_REPO_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} 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/.github/workflows/upgrade-provider.yml b/.github/workflows/upgrade-provider.yml index 423bc361..a820365e 100644 --- a/.github/workflows/upgrade-provider.yml +++ b/.github/workflows/upgrade-provider.yml @@ -5,7 +5,7 @@ env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} jobs: upgrade_provider: - if: ${{ contains(github.event.issue.title, 'Upgrade terraform-provider-') }} + if: ${{ contains(github.event.issue.title, 'Upgrade terraform-provider-') || github.event_name == 'workflow_dispatch' }} name: upgrade-provider runs-on: ubuntu-latest steps: diff --git a/Makefile b/Makefile index 6fc65735..92059cae 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,7 @@ JAVA_GEN := pulumi-java-gen JAVA_GEN_VERSION := v0.9.5 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: @@ -124,4 +124,26 @@ upstream.rebase: bin/pulumi-java-gen: $(shell pulumictl download-binary -n pulumi-language-java -v $(JAVA_GEN_VERSION) -r pulumi/pulumi-java) -.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 +# To make an immediately observable change to .ci-mgmt.yaml: +# +# - Edit .ci-mgmt.yaml +# - Run make ci-mgmt to apply the change locally. +# +ci-mgmt: .ci-mgmt.yaml + rm .github/workflows/*.yml # Copied from update-workflows.yml + go run github.com/pulumi/ci-mgmt/provider-ci@master generate \ + --name pulumi/pulumi-$(PACK) \ + --out . \ + --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