Skip to content

weekly-pulumi-update #34

weekly-pulumi-update

weekly-pulumi-update #34

name: weekly-pulumi-update
on:
repository_dispatch:
types: [run-pulumi-update-command]
schedule:
# Every Monday at 11AM UTC
- cron: 0 11 * * 1
workflow_dispatch: {}
permissions:
pull-requests: write
contents: write
env:
GOVERSION: "1.21.x"
jobs:
weekly-pulumi-update:
runs-on: ubuntu-latest
strategy:
fail-fast: true
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GOVERSION }}
- name: Install Yarn
run: curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.13.0
- name: Update PATH for Yarn
run: |
echo "$HOME/.yarn/bin" >> $GITHUB_PATH
echo "$HOME/.config/yarn/global/node_modules/.bin" >> $GITHUB_PATH
- name: Update Pulumi/Pulumi
id: gomod
run: |
git config --local user.email '[email protected]'
git config --local user.name 'pulumi-bot'
PULUMI_VERSION=$(./scripts/get-latest-pulumi-version.sh)
echo "Latest Pulumi version is $PULUMI_VERSION"
echo "PULUMI_VERSION=$PULUMI_VERSION" >> "$GITHUB_ENV"
git checkout -b update-pulumi/$PULUMI_VERSION-${{ github.run_id }}-${{ github.run_number }}
echo "Updating Pulumi dependencies to $PULUMI_VERSION"
./scripts/bump-pulumi-deps.sh --version "$PULUMI_VERSION"
echo "Updating node @pulumi/pulumi to $PULUMI_VERSION"
pushd awsx
# Strips the v from the version to get the correct npm version
yarn upgrade @pulumi/pulumi@${PULUMI_VERSION#v}
yarn run dedupe-deps
echo "Ensure that we don't have any duplicate dependencies"
yarn run check-duplicate-deps
popd
git update-index -q --refresh
if ! git diff-files --quiet; then
echo changes=1 >> "$GITHUB_OUTPUT"
fi
- name: Setup Node
if: steps.gomod.outputs.changes != 0
uses: actions/setup-node@v4
with:
node-version: ${{env.NODEVERSION}}
registry-url: https://registry.npmjs.org
- name: Install pulumictl
if: steps.gomod.outputs.changes != 0
uses: jaxxstorm/[email protected]
with:
repo: pulumi/pulumictl
- name: Install Pulumi CLI
if: steps.gomod.outputs.changes != 0
uses: pulumi/action-install-pulumi-cli@v2
- name: Build Provider
if: steps.gomod.outputs.changes != 0
run: |
make build
make lint
- name: Commit changes
if: steps.gomod.outputs.changes != 0
run: |
git add .
git commit -m "Update pulumi/pulumi version to $PULUMI_VERSION"
git push origin update-pulumi/$PULUMI_VERSION-${{ github.run_id }}-${{ github.run_number }}
- name: pull-request
if: steps.gomod.outputs.changes != 0
env:
GH_TOKEN: ${{ secrets.PULUMI_BOT_TOKEN }}
run: |
gh pr create --title "Update pulumi/pulumi version to $PULUMI_VERSION" --body "Upgrading pulumi/pkg and pulumi/sdk to version $PULUMI_VERSION."
- name: Enable auto-merge
if: steps.gomod.outputs.changes != 0 && github.event_name == 'schedule'
env:
GH_TOKEN: ${{ github.token }}
run: |
gh pr merge --squash --auto "1"
name: weekly-pulumi-update