Skip to content
Merged
Show file tree
Hide file tree
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
9 changes: 9 additions & 0 deletions .github/workflows/release-changelog-internal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,13 @@ jobs:
release_tag: ${{ github.ref_name }}
secrets:
GITHUB: ${{ secrets.GITHUB }}

release-major-tag:
needs: changelog
if: always()
uses: ./.github/workflows/release-maintain-major-tag.yml
with:
tag_name: ${{ github.ref_name }}
secrets:
GITHUB: ${{ secrets.GITHUB }}
...
18 changes: 13 additions & 5 deletions .github/workflows/release-maintain-major-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,15 @@
name: Release - Maintain Major Tag

on:
release:
types: [published]
workflow_call:
inputs:
tag_name:
description: 'Tag name to update major version for'
required: true
type: string
secrets:
GITHUB:
required: true

permissions:
contents: write
Expand All @@ -18,7 +25,7 @@ jobs:
- name: Check tag format
id: check
run: |
TAG=${{ github.event.release.tag_name }}
TAG="${{ inputs.tag_name }}"

echo "Release tag: $TAG"

Expand All @@ -40,6 +47,7 @@ jobs:
uses: actions/checkout@v6
with:
fetch-depth: 0
token: ${{ secrets.GITHUB }}

- name: Fetch tags
run: git fetch --tags
Expand All @@ -52,7 +60,7 @@ jobs:
- name: Extract major version
id: version
run: |
TAG=${{ github.event.release.tag_name }}
TAG="${{ inputs.tag_name }}"
MAJOR=$(echo "$TAG" | cut -d. -f1)
MAJOR_TAG="$MAJOR"

Expand All @@ -61,7 +69,7 @@ jobs:

- name: Update major tag
run: |
git tag -f ${{ steps.version.outputs.major_tag }} ${{ github.event.release.tag_name }}
git tag -f ${{ steps.version.outputs.major_tag }} ${{ inputs.tag_name }}

- name: Push major tag
run: |
Expand Down
18 changes: 16 additions & 2 deletions .github/workflows/tf-smurf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: 🦸‍♂️ Smurf Terraform workflow
on:
workflow_call:
inputs:
working_directory:
terraform_directory:
required: true
type: string
description: 'Root directory of the terraform where all resources exist.'
Expand Down Expand Up @@ -35,8 +35,12 @@ on:
description: 'Approvals list to approve apply or destroy'
smurf_version:
type: string
default: v0.0.9
default: latest
description: 'Required Smurf version'
terraform_version:
type: string
default: 1.3.6
description: 'Required Terraform version'
timeout:
required: false
type: number
Expand Down Expand Up @@ -177,6 +181,11 @@ jobs:
with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}

- name: 🛠️ Set up Terraform
uses: hashicorp/setup-terraform@v4
with:
terraform_version: ${{ inputs.terraform_version }}

- name: ⚙️ Set up Smurf Terraform
uses: clouddrove/smurf@v1.1.3

Expand Down Expand Up @@ -222,6 +231,11 @@ jobs:
- name: 📦 Checkout Repository
uses: actions/checkout@v6

- name: 🛠️ Set up Terraform
uses: hashicorp/setup-terraform@v4
with:
terraform_version: ${{ inputs.terraform_version }}

- name: ⚙️ Set up Smurf Terraform
uses: clouddrove/smurf@v1.1.3

Expand Down
11 changes: 8 additions & 3 deletions docs/release-maintain-major-tag.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ Example:
The workflow runs when a **GitHub Release is published**.

```yaml
on:
release:
types: [published]
release-major-tag:
needs: changelog
if: always()
uses: clouddrove/github-shared-workflows/.github/workflows/release-maintain-major-tag.yml
with:
tag_name: ${{ github.ref_name }}
secrets:
GITHUB: ${{ secrets.GITHUB }}
Loading