From 6cc35e94904823aa8ca7c7ebe1b409f2f455f4ba Mon Sep 17 00:00:00 2001 From: Pulumi Bot <30351955+pulumi-bot@users.noreply.github.com> Date: Thu, 5 Oct 2023 23:11:17 -0700 Subject: [PATCH] Update GitHub Actions workflows. (#197) This PR was automatically generated by the update-workflows-ecosystem-providers workflow in the pulumi/ci-mgmt repo, from commit ceeb0e7bc29c241d9d6a02b75866e423dc0a473b. --- .ci-mgmt.yaml | 9 +++ .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 | 32 ++++++-- 12 files changed, 45 insertions(+), 105 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 0000000..cb060b5 --- /dev/null +++ b/.ci-mgmt.yaml @@ -0,0 +1,9 @@ +provider: mailgun +major-version: 3 +env: + MAILGUN_API_KEY: ${{ secrets.MAILGUN_API_KEY }} +makeTemplate: bridged +plugins: + - name: aws + version: "4.0.0" +team: ecosystem diff --git a/.github/workflows/command-dispatch.yml b/.github/workflows/command-dispatch.yml index c1c45b8..dea9189 100644 --- a/.github/workflows/command-dispatch.yml +++ b/.github/workflows/command-dispatch.yml @@ -10,7 +10,7 @@ env: JAVAVERSION: "11" MAILGUN_API_KEY: ${{ secrets.MAILGUN_API_KEY }} 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 2c0af2e..9134b4f 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -15,7 +15,7 @@ env: JAVAVERSION: "11" MAILGUN_API_KEY: ${{ secrets.MAILGUN_API_KEY }} 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 5f8014f..1202ba7 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -10,7 +10,7 @@ env: JAVAVERSION: "11" MAILGUN_API_KEY: ${{ secrets.MAILGUN_API_KEY }} 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 3dc6bf4..862bfb2 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -11,7 +11,7 @@ env: JAVAVERSION: "11" MAILGUN_API_KEY: ${{ secrets.MAILGUN_API_KEY }} 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 c85ee01..908ae43 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -10,7 +10,7 @@ env: JAVAVERSION: "11" MAILGUN_API_KEY: ${{ secrets.MAILGUN_API_KEY }} 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 8a0c960..32b8c70 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,7 +10,7 @@ env: JAVAVERSION: "11" MAILGUN_API_KEY: ${{ secrets.MAILGUN_API_KEY }} 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 b8bd8fe..71ffe9f 100644 --- a/.github/workflows/resync-build.yml +++ b/.github/workflows/resync-build.yml @@ -12,7 +12,7 @@ env: JAVAVERSION: "11" MAILGUN_API_KEY: ${{ secrets.MAILGUN_API_KEY }} 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 4aabedb..0e1f141 100644 --- a/.github/workflows/run-acceptance-tests.yml +++ b/.github/workflows/run-acceptance-tests.yml @@ -11,7 +11,7 @@ env: JAVAVERSION: "11" MAILGUN_API_KEY: ${{ secrets.MAILGUN_API_KEY }} 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 17287db..0000000 --- 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 423bc36..a820365 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 9fa426b..1ce40fc 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,9 +94,8 @@ 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 - pulumi plugin install resource aws 4.0.0 +install_plugins: .pulumi/bin/pulumi + .pulumi/bin/pulumi plugin install resource aws 4.0.0 lint_provider: provider cd provider && golangci-lint run -c ../.golangci.yml @@ -108,7 +108,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: @@ -125,4 +125,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