Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 63 additions & 41 deletions .github/workflows/bump.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,68 @@
name: Bump Module Version in Dependent Repos

on:
push:
tags:
- 'v*'
push:
tags:
- "v*"

jobs:
update-version:
runs-on: ubuntu-latest
strategy:
matrix:
repo: ['terraform-aws-materialize', 'terraform-azurerm-materialize', 'terraform-google-materialize']

steps:
- name: Get the version
id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT

- name: Checkout dependent repository
uses: actions/checkout@v4
with:
repository: MaterializeInc/${{ matrix.repo }}
token: ${{ secrets.GH_PAT }}

- name: Update version reference
run: |
sed -i 's|github.com/MaterializeInc/terraform-helm-materialize?ref=v[0-9.]*|github.com/MaterializeInc/terraform-helm-materialize?ref=${{ steps.get_version.outputs.VERSION }}|' main.tf

- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GH_PAT }}
branch: update-helm-module-${{ steps.get_version.outputs.VERSION }}
title: "chore: Update terraform-helm-materialize to ${{ steps.get_version.outputs.VERSION }}"
body: |
Updates terraform-helm-materialize module to version ${{ steps.get_version.outputs.VERSION }}.

This PR was automatically generated.
commit-message: "chore: bump terraform-helm-materialize to ${{ steps.get_version.outputs.VERSION }}"
committer: GitHub <noreply@github.com>
author: GitHub <noreply@github.com>
labels: dependencies
base: main
delete-branch: true
signoff: true
update-version:
runs-on: ubuntu-latest
strategy:
matrix:
repo:
[
"terraform-aws-materialize",
"terraform-azurerm-materialize",
"terraform-google-materialize",
]

steps:
- name: Get the version
id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT

- name: Checkout dependent repository
uses: actions/checkout@v4
with:
repository: MaterializeInc/${{ matrix.repo }}
token: ${{ secrets.GH_PAT }}

- name: Update version reference
run: |
sed -i 's|github.com/MaterializeInc/terraform-helm-materialize?ref=v[0-9.]*|github.com/MaterializeInc/terraform-helm-materialize?ref=${{ steps.get_version.outputs.VERSION }}|' main.tf

- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: "~1.0"
terraform_wrapper: false

- name: Update .terraform.lock.hcl
run: |
# Initialize Terraform to update the lock file
terraform init -upgrade

# If lock file doesn't exist yet (unlikely but possible)
if [ ! -f .terraform.lock.hcl ]; then
echo "No lock file found. Creating it with terraform init."
terraform init
fi

- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GH_PAT }}
branch: update-helm-module-${{ steps.get_version.outputs.VERSION }}
title: "chore: Update terraform-helm-materialize to ${{ steps.get_version.outputs.VERSION }}"
body: |
Updates terraform-helm-materialize module to version ${{ steps.get_version.outputs.VERSION }}.

This PR was automatically generated and includes updated .terraform.lock.hcl file.
commit-message: "chore: bump terraform-helm-materialize to ${{ steps.get_version.outputs.VERSION }}"
committer: GitHub <noreply@github.com>
author: GitHub <noreply@github.com>
labels: dependencies
base: main
delete-branch: true
signoff: true