Skip to content

Commit

Permalink
Test updating upstream provider.
Browse files Browse the repository at this point in the history
  • Loading branch information
jkodroff committed Jan 26, 2022
1 parent 26d3a55 commit eb2c064
Showing 1 changed file with 124 additions and 0 deletions.
124 changes: 124 additions & 0 deletions .github/workflows/update-upstream-provider.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NUGET_PUBLISH_KEY: ${{ secrets.NUGET_PUBLISH_KEY }}
PROVIDER: cloudinit
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}
PULUMI_API: https://api.pulumi-staging.io
PULUMI_GO_DEP_ROOT: ${{ github.workspace }}/..
PULUMI_LOCAL_NUGET: ${{ github.workspace }}/nuget
PULUMI_PROVIDER_MAP_ERROR: true
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
TRAVIS_OS_NAME: linux
UPSTREAM_PROVIDER_ORG: hashicorp
UPSTREAM_PROVIDER_REPO: terraform-provider-cloudinit
jobs:
update_upstream_provider:
name: update-upstream_provider
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Unshallow clone for tags
run: git fetch --prune --unshallow --tags
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{matrix.goversion}}
- name: Install pulumictl
uses: jaxxstorm/action-install-gh-release@v1.2.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: ${{matrix.dotnetversion}}
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: ${{matrix.nodeversion}}
registry-url: https://registry.npmjs.org
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{matrix.pythonversion}}
- name: Get upstream provider sha
run: echo "UPSTREAM_PROVIDER_SHA=$(curl https://api.github.com/repos/${{ env.UPSTREAM_PROVIDER_ORG
}}/${{ env.UPSTREAM_PROVIDER_REPO }}/git/ref/tags/v${{ github.event.inputs.version
}} | jq .object.sha -r)" >> $GITHUB_ENV
- if: ${{ hashFiles('provider/shim/go.mod') != '' }}
name: Update shim/go.mod
run: cd provider/shim && go mod edit -require github.com/${{ env.UPSTREAM_PROVIDER_ORG
}}/${{ env.UPSTREAM_PROVIDER_REPO }}@${{ env.UPSTREAM_PROVIDER_SHA }} && go
mod tidy
- name: Update go.mod
run: cd provider && go mod edit -require github.com/${{ env.UPSTREAM_PROVIDER_ORG
}}/${{ env.UPSTREAM_PROVIDER_REPO }}@${{ env.UPSTREAM_PROVIDER_SHA }} && go
mod tidy
- run: make tfgen
- run: make build_sdks
- if: ${{ !github.event.inputs.linked_issue_number }}
name: Create PR
uses: peter-evans/create-pull-request@v3.12.0
with:
author: pulumi-bot <bot@pulumi.com>
base: master
body: This pull request was generated automatically by the update-upstream-provider
workflow in this repository.
branch: pulumi-bot/v${{ github.event.inputs.version }}-${{ github.run_id}}
commit-message: Update ${{ env.UPSTREAM_PROVIDER_REPO }} to v${{ github.event.inputs.version
}}
committer: pulumi-bot <bot@pulumi.com>
labels: impact/no-changelog-required
reviewers: pulumi/platform-integrations
title: Update ${{ env.UPSTREAM_PROVIDER_REPO }} to v${{ github.event.inputs.version
}}
token: ${{ secrets.PULUMI_BOT_TOKEN }}
- if: ${{ github.event.inputs.linked_issue_number }}
name: Create PR
uses: peter-evans/create-pull-request@v3.12.0
with:
author: pulumi-bot <bot@pulumi.com>
base: master
body: |-
Fixes #${{ github.event.inputs.linked_issue_number }}
This pull request was generated automatically by the update-upstream-provider workflow in this repository.
branch: pulumi-bot/v${{ github.event.inputs.version }}-${{ github.run_id}}
commit-message: Update ${{ env.UPSTREAM_PROVIDER_REPO }} to v${{ github.event.inputs.version
}}
committer: pulumi-bot <bot@pulumi.com>
labels: impact/no-changelog-required
reviewers: pulumi/platform-integrations
title: Update ${{ env.UPSTREAM_PROVIDER_REPO }} to v${{ github.event.inputs.version
}}
token: ${{ secrets.PULUMI_BOT_TOKEN }}
strategy:
fail-fast: true
matrix:
dotnetversion:
- 3.1.301
goversion:
- 1.17.x
nodeversion:
- 14.x
pythonversion:
- "3.7"
name: Update upstream provider
"on":
workflow_dispatch:
inputs:
linked_issue_number:
description: The issue number of a PR in this repository to which the generated
pull request should be linked.
required: true
type: string
version:
description: The new version of the upstream provider. Do not include the
'v' prefix.
required: true
type: string

0 comments on commit eb2c064

Please sign in to comment.