Skip to content

Commit

Permalink
Inline upgrade provider action (#1097)
Browse files Browse the repository at this point in the history
This action was originally failing due to missing dotnet if we run the
disk clean-up action first. Then when trying to install dotnet using the
setup-tools action, it was failing because the repo wasn't yet checked
out, however, the `pulumi-upgrade-provider-action` does it's own
checkout action, so it would have required removing the checkout from
that action, creating a new version, then upgrading the version via
ci-mgmt. At this point the `pulumi-upgrade-provider-action` would only
contain the install and execution of the upgrade-provider CLI tool.

## Change summary

- Go direct to the `upgrade-provider` program instead of via the
`pulumi-upgrade-provider-action` wrapper action.
- Enables us to use the shared setup-tools action for tool consistency.

## References

- Existing wrapper action:
https://github.com/pulumi/pulumi-upgrade-provider-action/blob/main/action.yml
- Sample run:
https://github.com/pulumi/pulumi-azure/actions/runs/11219063931/job/31184185595
  • Loading branch information
danielrbradley authored Oct 7, 2024
1 parent b1f731c commit 07f4afb
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,27 @@ jobs:
swap-storage: false
dotnet: false
#{{- end }}#
- name: Checkout Repo
uses: #{{ .Config.actionVersions.checkout }}#
#{{- if .Config.checkoutSubmodules }}#
with:
submodules: #{{ .Config.checkoutSubmodules }}#
#{{- end }}#
- name: Setup tools
uses: ./.github/actions/setup-tools
with:
tools: pulumictl, pulumicli, go, nodejs, dotnet, python, java
- name: Call upgrade provider action
uses: #{{ .Config.actionVersions.upgradeProviderAction }}#
with:
kind: all
#{{- if .Config.javaGenVersion }}#
target-java-version: #{{ .Config.javaGenVersion }}#
#{{- end }}#
email: bot@pulumi.com
username: pulumi-bot
- name: Install upgrade-provider
run: go install github.com/pulumi/upgrade-provider@main
shell: bash
- name: "Set up git identity: name"
run: |
git config --global user.name 'bot@pulumi.com'
git config --global user.email 'bot@pulumi.com'
shell: bash
- name: Run upgrade-provider
run: upgrade-provider "${{ github.repository }}" --kind="all" #{{ if .Config.javaGenVersion }}#--java-version="#{{ .Config.javaGenVersion }}#"#{{ end }}#
shell: bash
name: Upgrade provider
on:
issues:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,23 @@ jobs:
name: upgrade-provider
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Setup tools
uses: ./.github/actions/setup-tools
with:
tools: pulumictl, pulumicli, go, nodejs, dotnet, python, java
- name: Call upgrade provider action
uses: pulumi/pulumi-upgrade-provider-action@v0.0.12
with:
kind: all
email: bot@pulumi.com
username: pulumi-bot
- name: Install upgrade-provider
run: go install github.com/pulumi/upgrade-provider@main
shell: bash
- name: "Set up git identity: name"
run: |
git config --global user.name 'bot@pulumi.com'
git config --global user.email 'bot@pulumi.com'
shell: bash
- name: Run upgrade-provider
run: upgrade-provider "${{ github.repository }}" --kind="all"
shell: bash
name: Upgrade provider
on:
issues:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,25 @@ jobs:
tool-cache: false
swap-storage: false
dotnet: false
- name: Checkout Repo
uses: actions/checkout@v4
with:
submodules: true
- name: Setup tools
uses: ./.github/actions/setup-tools
with:
tools: pulumictl, pulumicli, go, nodejs, dotnet, python, java
- name: Call upgrade provider action
uses: pulumi/pulumi-upgrade-provider-action@v0.0.12
with:
kind: all
email: bot@pulumi.com
username: pulumi-bot
- name: Install upgrade-provider
run: go install github.com/pulumi/upgrade-provider@main
shell: bash
- name: "Set up git identity: name"
run: |
git config --global user.name 'bot@pulumi.com'
git config --global user.email 'bot@pulumi.com'
shell: bash
- name: Run upgrade-provider
run: upgrade-provider "${{ github.repository }}" --kind="all"
shell: bash
name: Upgrade provider
on:
issues:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,23 @@ jobs:
name: upgrade-provider
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Setup tools
uses: ./.github/actions/setup-tools
with:
tools: pulumictl, pulumicli, go, nodejs, dotnet, python, java
- name: Call upgrade provider action
uses: pulumi/pulumi-upgrade-provider-action@v0.0.12
with:
kind: all
email: bot@pulumi.com
username: pulumi-bot
- name: Install upgrade-provider
run: go install github.com/pulumi/upgrade-provider@main
shell: bash
- name: "Set up git identity: name"
run: |
git config --global user.name 'bot@pulumi.com'
git config --global user.email 'bot@pulumi.com'
shell: bash
- name: Run upgrade-provider
run: upgrade-provider "${{ github.repository }}" --kind="all"
shell: bash
name: Upgrade provider
on:
issues:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,23 @@ jobs:
name: upgrade-provider
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Setup tools
uses: ./.github/actions/setup-tools
with:
tools: pulumictl, pulumicli, go, nodejs, dotnet, python, java
- name: Call upgrade provider action
uses: pulumi/pulumi-upgrade-provider-action@v0.0.12
with:
kind: all
email: bot@pulumi.com
username: pulumi-bot
- name: Install upgrade-provider
run: go install github.com/pulumi/upgrade-provider@main
shell: bash
- name: "Set up git identity: name"
run: |
git config --global user.name 'bot@pulumi.com'
git config --global user.email 'bot@pulumi.com'
shell: bash
- name: Run upgrade-provider
run: upgrade-provider "${{ github.repository }}" --kind="all"
shell: bash
name: Upgrade provider
on:
issues:
Expand Down

0 comments on commit 07f4afb

Please sign in to comment.