From 6107ad29e96182faff66ef97b7091ad3e528667d Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 22 Apr 2026 17:58:46 +0000 Subject: [PATCH 1/6] ci: add commitlint workflow for pr validation https://claude.ai/code/session_01RsmDFm6w4jVXwvzmRd9BCv --- .github/workflows/lint-commits.yml | 20 ++++++++++++++++++++ commitlint.config.mjs | 3 +++ 2 files changed, 23 insertions(+) create mode 100644 .github/workflows/lint-commits.yml create mode 100644 commitlint.config.mjs diff --git a/.github/workflows/lint-commits.yml b/.github/workflows/lint-commits.yml new file mode 100644 index 0000000..dd6eca9 --- /dev/null +++ b/.github/workflows/lint-commits.yml @@ -0,0 +1,20 @@ +name: lint-commits +on: + pull_request: + branches: + - master + +permissions: + contents: read + pull-requests: read + +jobs: + commitlint: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: wagoid/commitlint-github-action@v6 + with: + configFile: commitlint.config.mjs diff --git a/commitlint.config.mjs b/commitlint.config.mjs new file mode 100644 index 0000000..b29b5ae --- /dev/null +++ b/commitlint.config.mjs @@ -0,0 +1,3 @@ +export default { + extends: ["@commitlint/config-conventional"], +}; From 10188cf7003ce59f4c8e12a887cbdfbc2bbd701e Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 22 Apr 2026 17:58:48 +0000 Subject: [PATCH 2/6] ci: add pr title semantic check https://claude.ai/code/session_01RsmDFm6w4jVXwvzmRd9BCv --- .github/workflows/lint-pr-title.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/workflows/lint-pr-title.yml diff --git a/.github/workflows/lint-pr-title.yml b/.github/workflows/lint-pr-title.yml new file mode 100644 index 0000000..1b49938 --- /dev/null +++ b/.github/workflows/lint-pr-title.yml @@ -0,0 +1,20 @@ +name: lint-pr-title +on: + pull_request: + branches: + - master + types: + - opened + - edited + - synchronize + +permissions: + pull-requests: read + +jobs: + lint-pr-title: + runs-on: ubuntu-22.04 + steps: + - uses: amannn/action-semantic-pull-request@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 45e46215d27b9f6817e8767a1a65859eb626361d Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 22 Apr 2026 17:58:51 +0000 Subject: [PATCH 3/6] ci: add semantic-release workflow https://claude.ai/code/session_01RsmDFm6w4jVXwvzmRd9BCv --- .github/workflows/semantic-release.yml | 32 ++++++++++++++++++++++++++ .releaserc.json | 21 +++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 .github/workflows/semantic-release.yml create mode 100644 .releaserc.json diff --git a/.github/workflows/semantic-release.yml b/.github/workflows/semantic-release.yml new file mode 100644 index 0000000..d1397de --- /dev/null +++ b/.github/workflows/semantic-release.yml @@ -0,0 +1,32 @@ +name: semantic-release +on: + push: + branches: + - master + paths: + - Dockerfile + - supported_versions.json + - "security/**" + - "tests/**" + - .dockerignore + - hadolint.yaml + - ".github/workflows/semantic-release.yml" + - ".github/workflows/release.yml" + - CHANGELOG.md + +permissions: + contents: write + issues: write + pull-requests: write + +jobs: + release: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + persist-credentials: false + - uses: cycjimmy/semantic-release-action@v4 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.releaserc.json b/.releaserc.json new file mode 100644 index 0000000..87c2392 --- /dev/null +++ b/.releaserc.json @@ -0,0 +1,21 @@ +{ + "branches": ["master"], + "plugins": [ + "@semantic-release/commit-analyzer", + "@semantic-release/release-notes-generator", + [ + "@semantic-release/changelog", + { + "changelogFile": "CHANGELOG.md" + } + ], + [ + "@semantic-release/git", + { + "assets": ["CHANGELOG.md"], + "message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}" + } + ], + "@semantic-release/github" + ] +} From f820f7a09e25d5bcb3d45e74c9ec2fe7def752a6 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 22 Apr 2026 17:58:55 +0000 Subject: [PATCH 4/6] ci(release): refactor release workflow to trigger on semver tags https://claude.ai/code/session_01RsmDFm6w4jVXwvzmRd9BCv --- .github/workflows/push-latest.yml | 5 +- .github/workflows/release.yml | 95 +++++++++++++++++++------------ 2 files changed, 64 insertions(+), 36 deletions(-) diff --git a/.github/workflows/push-latest.yml b/.github/workflows/push-latest.yml index eda62d0..cd94477 100644 --- a/.github/workflows/push-latest.yml +++ b/.github/workflows/push-latest.yml @@ -30,7 +30,10 @@ jobs: echo "AWS_VERSION=$(jq -r '.awscli_versions | sort | .[-1]' supported_versions.json)" >> $GITHUB_ENV - name: Login to Docker Hub registry - run: echo '${{ secrets.DOCKERHUB_PAT }}' | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PAT }} - name: Set up QEMU uses: docker/setup-qemu-action@v2 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 494c841..97c646c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,23 +1,25 @@ name: release - -# trigger on published release on: - release: - types: [published] + push: + tags: + - "v*" + +permissions: + contents: read + packages: write + +env: + ORGANIZATION: "bgauduch" + IMAGE_NAME: "terraform-aws-cli" jobs: load_supported_versions: runs-on: ubuntu-22.04 - outputs: matrix: ${{ steps.set-matrix.outputs.matrix }} - steps: - - name: Check out the repo - uses: actions/checkout@v3 - - - name: Save supported versions as output - id: set-matrix + - uses: actions/checkout@v4 + - id: set-matrix run: | VERSIONS=$(cat ./supported_versions.json | jq -c) echo "matrix=${VERSIONS}" >> $GITHUB_OUTPUT @@ -25,39 +27,62 @@ jobs: build_push_release: runs-on: ubuntu-22.04 needs: load_supported_versions - strategy: matrix: ${{ fromJSON(needs.load_supported_versions.outputs.matrix) }} - - env: - ORGANIZATION: "zenika" - IMAGE_NAME: "terraform-aws-cli" - steps: - - name: Check out the repo - uses: actions/checkout@v3 - - - name: Get and save the release tag - run: echo "RELEASE_TAG=${GITHUB_REF##*/}" >> $GITHUB_ENV - - - name: Login to Docker Hub registry - run: echo '${{ secrets.DOCKERHUB_PAT }}' | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - name: Set up Buildx - uses: docker/setup-buildx-action@v2 - - - name: Build and push container images - uses: docker/build-push-action@v4 + - uses: actions/checkout@v4 + - name: Get release version + run: echo "RELEASE_VERSION=${GITHUB_REF_NAME}" >> $GITHUB_ENV + - name: Get minor versions for floating tags + run: | + TF_MINOR=$(echo "${{ matrix.tf_versions }}" | cut -d. -f1-2) + AWS_MINOR=$(echo "${{ matrix.awscli_versions }}" | cut -d. -f1-2) + echo "TF_MINOR=${TF_MINOR}" >> $GITHUB_ENV + echo "AWS_MINOR=${AWS_MINOR}" >> $GITHUB_ENV + - name: Check if this is the latest version combination + run: | + LATEST_TF=$(jq -r '.tf_versions | sort | .[-1]' supported_versions.json) + LATEST_AWS=$(jq -r '.awscli_versions | sort | .[-1]' supported_versions.json) + if [ "${{ matrix.tf_versions }}" = "${LATEST_TF}" ] && [ "${{ matrix.awscli_versions }}" = "${LATEST_AWS}" ]; then + echo "IS_LATEST=true" >> $GITHUB_ENV + else + echo "IS_LATEST=false" >> $GITHUB_ENV + fi + - uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PAT }} + - uses: docker/setup-qemu-action@v3 + - uses: docker/setup-buildx-action@v3 + - name: Build and push (non-latest) + if: env.IS_LATEST != 'true' + uses: docker/build-push-action@v6 + with: + context: . + platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/386 + build-args: | + TERRAFORM_VERSION=${{ matrix.tf_versions }} + AWS_CLI_VERSION=${{ matrix.awscli_versions }} + tags: | + ${{ env.ORGANIZATION }}/${{ env.IMAGE_NAME }}:${{ env.RELEASE_VERSION }}_tf-${{ matrix.tf_versions }}_aws-${{ matrix.awscli_versions }} + ${{ env.ORGANIZATION }}/${{ env.IMAGE_NAME }}:tf-${{ env.TF_MINOR }}_aws-${{ env.AWS_MINOR }} + push: true + cache-from: type=gha + cache-to: type=gha,mode=max + - name: Build and push (latest) + if: env.IS_LATEST == 'true' + uses: docker/build-push-action@v6 with: context: . platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/386 build-args: | TERRAFORM_VERSION=${{ matrix.tf_versions }} AWS_CLI_VERSION=${{ matrix.awscli_versions }} - tags: zenika/terraform-aws-cli:release-${{ env.RELEASE_TAG }}_terraform-${{ matrix.tf_versions }}_awscli-${{ matrix.awscli_versions }} + tags: | + ${{ env.ORGANIZATION }}/${{ env.IMAGE_NAME }}:${{ env.RELEASE_VERSION }}_tf-${{ matrix.tf_versions }}_aws-${{ matrix.awscli_versions }} + ${{ env.ORGANIZATION }}/${{ env.IMAGE_NAME }}:tf-${{ env.TF_MINOR }}_aws-${{ env.AWS_MINOR }} + ${{ env.ORGANIZATION }}/${{ env.IMAGE_NAME }}:latest + ${{ env.ORGANIZATION }}/${{ env.IMAGE_NAME }}:${{ env.RELEASE_VERSION }} push: true cache-from: type=gha cache-to: type=gha,mode=max From 43cc69a3cd15ff1aad549d2f736b838ff8016469 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 22 Apr 2026 17:58:58 +0000 Subject: [PATCH 5/6] docs: add initial CHANGELOG.md https://claude.ai/code/session_01RsmDFm6w4jVXwvzmRd9BCv --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..b72fa28 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,5 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +This file is auto-generated by [Semantic Release](https://semantic-release.gitbook.io/). From 7ed5634f40539f25d9dc587b4484cac3f05d3aff Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 22 Apr 2026 18:00:01 +0000 Subject: [PATCH 6/6] chore: ignore claude code internal directory --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 6753769..fbbe54a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,5 @@ # ignore generated container structure test config tests/container-structure-tests.yml + +# Claude Code internal directory +.claude/