diff --git a/.github/workflows/update-providers-auto.yml b/.github/workflows/update-providers-auto.yml new file mode 100644 index 000000000..960d76316 --- /dev/null +++ b/.github/workflows/update-providers-auto.yml @@ -0,0 +1,45 @@ +name: Update Providers with new bridge version upon release +on: + push: + tags: + # Typically pf* module is tagged after the main module, so this is a good time to fire off + # automatic downstream upgrades. + - 'pf/**' + +env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + +jobs: + generate-providers-list: + runs-on: ubuntu-latest + steps: + - id: get-providers + run: echo "providers=$(jq . <(curl https://raw.githubusercontent.com/pulumi/ci-mgmt/master/provider-ci/providers.json) --compact-output)" >> "$GITHUB_OUTPUT" + outputs: + providers: ${{ steps.get-providers.outputs.providers }} + + build: + runs-on: ubuntu-latest + name: Upgrade ${{ matrix.provider }} to pulumi-terraform-bridge to the latest version automatically + steps: + - name: Trigger upgrade + uses: peter-evans/repository-dispatch@v2 + with: + token: ${{ secrets.PULUMI_BOT_TOKEN }} + repository: pulumi/pulumi-${{ matrix.provider }} + event-type: upgrade-bridge + # Not specifying target-bridge-version in the payload will make it upgrade to the latest. + client-payload: |- + { + "pr-reviewers": "t0yv0", + "automerge": true + } + needs: generate-providers-list + strategy: + # GitHub recommends only issuing 1 API request per second, and never + # concurrently. For more information, see: + # https://docs.github.com/en/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits + max-parallel: 1 + matrix: + provider: ${{ fromJson(needs.generate-providers-list.outputs.providers ) }} + fail-fast: false diff --git a/.github/workflows/update-providers-ci-mgmt.yml b/.github/workflows/update-providers-ci-mgmt.yml deleted file mode 100644 index cd094d5e0..000000000 --- a/.github/workflows/update-providers-ci-mgmt.yml +++ /dev/null @@ -1,11 +0,0 @@ -name: Update Providers with new bridge version via ci-mgmt -on: - workflow_dispatch: -jobs: - update-providers: - name: update-providers - runs-on: ubuntu-latest - steps: - - name: Check out source code - uses: actions/checkout@master - # TBD diff --git a/.github/workflows/update-providers.yml b/.github/workflows/update-providers.yml index b6ec371a1..5c3381c85 100644 --- a/.github/workflows/update-providers.yml +++ b/.github/workflows/update-providers.yml @@ -5,72 +5,47 @@ on: bridgeVersion: description: 'Version of Bridge to upgrade to' required: true + automerge: + description: 'Whether to automerge the PRs' + type: boolean + default: false + required: false env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} jobs: + + generate-providers-list: + runs-on: ubuntu-latest + steps: + - id: get-providers + run: echo "providers=$(jq . <(curl https://raw.githubusercontent.com/pulumi/ci-mgmt/master/provider-ci/providers.json) --compact-output)" >> "$GITHUB_OUTPUT" + outputs: + providers: ${{ steps.get-providers.outputs.providers }} + build: runs-on: ubuntu-latest name: Upgrade ${{ matrix.provider }} to pulumi-terraform-bridge ${{ github.event.inputs.bridgeVersion }} steps: - - name: Install pulumictl - uses: jaxxstorm/action-install-gh-release@v1.1.0 + - name: Trigger upgrade + uses: peter-evans/repository-dispatch@v2 with: - repo: pulumi/pulumictl - - name: Trigger Update - run: pulumictl dispatch -r pulumi/${{ matrix.provider }} -c update-bridge ${{ github.event.inputs.bridgeVersion }} - env: - GITHUB_TOKEN: ${{ secrets.PULUMI_BOT_TOKEN}} + token: ${{ secrets.PULUMI_BOT_TOKEN }} + repository: pulumi/pulumi-${{ matrix.provider }} + event-type: upgrade-bridge + client-payload: |- + { + "target-bridge-version": ${{ toJSON(github.event.inputs.bridgeVersion) }}, + "pr-reviewers": ${{ toJSON( github.triggering_actor || 't0yv0' ) }}, + "automerge": ${{ toJSON(github.event.inputs.automerge) }} + } + needs: generate-providers-list strategy: - fail-fast: false + # GitHub recommends only issuing 1 API request per second, and never + # concurrently. For more information, see: + # https://docs.github.com/en/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits + max-parallel: 1 matrix: - provider: - - pulumi-aiven - - pulumi-akamai - - pulumi-alicloud - - pulumi-auth0 - - pulumi-aws - - pulumi-azure - - pulumi-azuread - - pulumi-azuredevops - - pulumi-civo - - pulumi-cloudamqp - - pulumi-cloudflare - - pulumi-cloudinit - - pulumi-consul - - pulumi-datadog - - pulumi-digitalocean - - pulumi-dnsimple - - pulumi-docker - - pulumi-equinix-metal - - pulumi-f5bigip - - pulumi-fastly - - pulumi-gcp - - pulumi-github - - pulumi-gitlab - - pulumi-hcloud - - pulumi-kafka - - pulumi-keycloak - - pulumi-kong - - pulumi-linode - - pulumi-mailgun - - pulumi-mongodbatlas - - pulumi-mysql - - pulumi-newrelic - - pulumi-ns1 - - pulumi-okta - - pulumi-openstack - - pulumi-pagerduty - - pulumi-postgresql - - pulumi-rabbitmq - - pulumi-rancher2 - - pulumi-random - - pulumi-signalfx - - pulumi-splunk - - pulumi-spotinst - - pulumi-tls - - pulumi-vault - - pulumi-venafi - - pulumi-vsphere - - pulumi-wavefront + provider: ${{ fromJson(needs.generate-providers-list.outputs.providers ) }} + fail-fast: false