weekly-pulumi-update #200
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: weekly-pulumi-update | |
on: | |
schedule: | |
- cron: 35 12 * * 4 | |
workflow_dispatch: {} | |
env: | |
GITHUB_TOKEN: ${{ secrets.PULUMI_BOT_TOKEN }} | |
PULUMI_LOCAL_NUGET: ${{ github.workspace }}/nuget | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
PULUMI_GO_DEP_ROOT: ${{ github.workspace }}/.. | |
PROVIDER_VERSION: 2.0.0-alpha.0+dev | |
jobs: | |
weekly-pulumi-update: | |
# Use a more powerful runner to fix pulumi/pulumi-azure-native#2768 | |
runs-on: pulumi-ubuntu-8core | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
# We need a full checkout so we can push commits back | |
fetch-depth: 0 | |
- name: Install Languages & Frameworks | |
uses: ./.github/actions/install | |
- name: Update Pulumi/Pulumi | |
id: gomod | |
run: | | |
git config --local user.email '[email protected]' | |
git config --local user.name 'pulumi-bot' | |
git checkout -b update-pulumi/${{ github.run_id }}-${{ github.run_number }} | |
make upgrade_tools | |
cd provider | |
go get github.com/pulumi/pulumi/pkg/v3 | |
go get github.com/pulumi/pulumi/sdk/v3 | |
go mod download | |
go mod tidy | |
cd ../sdk | |
go get github.com/pulumi/pulumi/sdk/v3 | |
go mod download | |
go mod tidy | |
cd .. | |
git update-index -q --refresh | |
if ! git diff-files --quiet; then | |
echo "changes=1" >> "$GITHUB_OUTPUT" | |
fi | |
- run: make ensure | |
- name: Provider with Pulumi Upgrade | |
if: steps.gomod.outputs.changes != 0 | |
run: | | |
make codegen && make local_generate | |
git add sdk/nodejs | |
git commit -m "Regenerating Node.js SDK based on updated modules" || echo "ignore commit failure, may be empty" | |
git add sdk/python | |
git commit -m "Regenerating Python SDK based on updated modules" || echo "ignore commit failure, may be empty" | |
git add sdk/dotnet | |
git commit -m "Regenerating .NET SDK based on updated modules" || echo "ignore commit failure, may be empty" | |
git add sdk/go* | |
git commit -m "Regenerating Go SDK based on updated modules" || echo "ignore commit failure, may be empty" | |
git add sdk/java* | |
git commit -m "Regenerating Java SDK based on updated modules" || echo "ignore commit failure, may be empty" | |
git add . | |
git commit -m "Updated modules" | |
git push origin update-pulumi/${{ github.run_id }}-${{ github.run_number }} | |
- name: Create PR | |
id: create-pr | |
if: steps.gomod.outputs.changes != 0 | |
uses: repo-sync/[email protected] | |
with: | |
source_branch: update-pulumi/${{ github.run_id }}-${{ github.run_number }} | |
destination_branch: master | |
pr_title: Automated Pulumi/Pulumi upgrade | |
github_token: ${{ secrets.PULUMI_BOT_TOKEN }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.PULUMI_BOT_TOKEN }} | |
- name: Set AutoMerge | |
if: steps.create-pr.outputs.has_changed_files | |
run: gh pr merge ${{ steps.create-pr.outputs.pr_number }} --squash --auto --repo ${{ github.repository }} | |
env: | |
GH_TOKEN: ${{ secrets.PULUMI_BOT_TOKEN }} | |
name: weekly-pulumi-update |