upgrade-cdktf #156
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
# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". | |
name: upgrade-cdktf | |
on: | |
schedule: | |
- cron: 35 */6 * * * | |
workflow_dispatch: {} | |
concurrency: ${{ github.workflow }}-${{ github.ref }} | |
jobs: | |
upgrade: | |
name: Upgrade CDKTF | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
env: | |
CI: "true" | |
CHECKPOINT_DISABLE: "1" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 | |
- name: Install | |
run: yarn install | |
- name: Get current CDKTF version | |
id: current_version | |
run: |- | |
OLD_VERSION=$(npm list cdktf --depth=0 --json | jq -r '.dependencies.cdktf.version') | |
OLD_VERSION_SHORT=$(cut -d "." -f 2 <<< "$OLD_VERSION") | |
echo "value=$OLD_VERSION" >> $GITHUB_OUTPUT | |
echo "short=$OLD_VERSION_SHORT" >> $GITHUB_OUTPUT | |
- name: Get latest CDKTF version | |
id: latest_version | |
run: |- | |
CDKTF_VERSION=$(yarn info cdktf --json | jq -r '.data.version') | |
CDKTF_VERSION_SHORT=$(cut -d "." -f 2 <<< "$CDKTF_VERSION") | |
echo "value=$CDKTF_VERSION" >> $GITHUB_OUTPUT | |
echo "short=$CDKTF_VERSION_SHORT" >> $GITHUB_OUTPUT | |
- name: Run upgrade script | |
if: steps.current_version.outputs.short != steps.latest_version.outputs.short | |
run: scripts/update-cdktf.sh ${{ steps.latest_version.outputs.value }} | |
- name: Create draft pull request | |
if: steps.current_version.outputs.short != steps.latest_version.outputs.short | |
uses: peter-evans/create-pull-request@284f54f989303d2699d373481a0cfa13ad5a6666 | |
with: | |
commit-message: "chore!: upgrade to cdktf ${{ steps.latest_version.outputs.value }}" | |
branch: auto/upgrade-cdktf-${{ steps.latest_version.outputs.short }} | |
base: main | |
title: "chore!: upgrade to cdktf ${{ steps.latest_version.outputs.value }}" | |
body: |- | |
This PR initiates the upgrade of CDKTF from version `${{ steps.current_version.outputs.value }}` to version `${{ steps.latest_version.outputs.value }}`. | |
Unfortunately, not everything can be automated, and the following steps need to be completed manually: | |
- [ ] Update `@cdktf/provider-null` to a version compatible with `cdktf@${{ steps.latest_version.outputs.value }}` [here](https://github.com/cdktf/cdktf-tf-module-stack/blob/106036d2d6b65652b68dabb2648b1f7980c6421d/.projenrc.ts#L78). Look up the version [here](https://github.com/cdktf/cdktf-provider-null/releases/). | |
- [ ] Update `@cdktf/provider-random` to a version compatible with `cdktf@${{ steps.latest_version.outputs.value }}` [here](https://github.com/cdktf/cdktf-tf-module-stack/blob/106036d2d6b65652b68dabb2648b1f7980c6421d/.projenrc.ts#L79). Look up the version [here](https://github.com/cdktf/cdktf-provider-random/releases/). | |
- [ ] Run `npx projen` | |
Please checkout this PR, complete the above steps, push the changes to this branch, and then mark this PR as ready for review to complete the upgrade. Thanks! | |
labels: automerge,auto-approve,dependencies | |
token: ${{ secrets.PROJEN_GITHUB_TOKEN }} | |
author: team-tf-cdk <[email protected]> | |
committer: team-tf-cdk <[email protected]> | |
signoff: true | |
delete-branch: true | |
draft: true |