From f35037e801caf50aaf506af30c4ea4dbc254e500 Mon Sep 17 00:00:00 2001 From: ChristophShyper <45788587+ChristophShyper@users.noreply.github.com> Date: Tue, 12 Aug 2025 00:32:12 +0200 Subject: [PATCH 1/2] Update workflow dispatch --- .github/workflows/AUTO-RELEASE.yml | 91 -------- .github/workflows/AUTO-VERSION.yml | 207 ------------------ .github/workflows/CRON.yml | 33 --- .github/workflows/PUSH-MASTER.yml | 63 ------ .github/workflows/PUSH-OTHER.yml | 179 --------------- .github/workflows/RELEASE.yml | 183 ---------------- .github/workflows/pull-request.yml | 86 ++++++++ .github/workflows/release.yml | 76 +++++++ .github/workflows/weekly-dependency-check.yml | 68 ++++++ Makefile | 6 +- action.yml | 2 +- 11 files changed, 234 insertions(+), 760 deletions(-) delete mode 100644 .github/workflows/AUTO-RELEASE.yml delete mode 100644 .github/workflows/AUTO-VERSION.yml delete mode 100644 .github/workflows/CRON.yml delete mode 100644 .github/workflows/PUSH-MASTER.yml delete mode 100644 .github/workflows/PUSH-OTHER.yml delete mode 100644 .github/workflows/RELEASE.yml create mode 100644 .github/workflows/pull-request.yml create mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/weekly-dependency-check.yml diff --git a/.github/workflows/AUTO-RELEASE.yml b/.github/workflows/AUTO-RELEASE.yml deleted file mode 100644 index 09286a1..0000000 --- a/.github/workflows/AUTO-RELEASE.yml +++ /dev/null @@ -1,91 +0,0 @@ -name: Automated Release - -on: - workflow_dispatch: - inputs: - version: - description: 'Release version (e.g., v0.12.0)' - required: true - type: string - release_type: - description: 'Type of release' - required: true - default: 'patch' - type: choice - options: - - patch - - minor - - major - -jobs: - create_automated_release: - name: Create Automated Release - runs-on: ubuntu-24.04-arm - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Validate version format - run: | - VERSION="${{ github.event.inputs.version }}" - if [[ ! $VERSION =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then - echo "❌ Invalid version format. Use format: v1.2.3" - exit 1 - fi - echo "✅ Version format is valid: $VERSION" - - - name: Check if version already exists - run: | - VERSION="${{ github.event.inputs.version }}" - if git tag -l | grep -q "^${VERSION}$"; then - echo "❌ Version $VERSION already exists" - exit 1 - fi - echo "✅ Version $VERSION is available" - - - name: Get current date - id: date - run: echo "date=$(date +'%Y-%m-%d %H:%M:%S UTC')" >> $GITHUB_OUTPUT - - - name: Update version in action.yml - run: | - VERSION="${{ github.event.inputs.version }}" - sed -i "s|image: docker://devopsinfra/action-commit-push:.*|image: docker://devopsinfra/action-commit-push:${VERSION}|" action.yml - echo "✅ Updated action.yml to use version: ${VERSION}" - - - name: Update version in Makefile - run: | - VERSION="${{ github.event.inputs.version }}" - # Update the fallback version in Makefile - sed -i "s|echo \"v[0-9]\+\.[0-9]\+\.[0-9]\+\"|echo \"${VERSION}\"|" Makefile - echo "✅ Updated Makefile fallback version to: ${VERSION}" - - - name: Create release branch and commit changes - uses: devops-infra/action-commit-push@v0.11.1 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - target_branch: release/${{ github.event.inputs.version }} - commit_message: | - 🤖 Automated Release ${{ github.event.inputs.version }} - - Release Details - - **Version**: `${{ github.event.inputs.version }}` - - **Type**: `${{ github.event.inputs.release_type }}` - - **Triggered by**: @${{ github.actor }} - - **Date**: ${{ steps.date.outputs.date }} - - What happens when this PR is merged? - 1. 🐳 Docker images will be built and pushed to Docker Hub and GitHub Packages - 2. 🏷️ A GitHub release will be created with tag `${{ github.event.inputs.version }}` - 3. 📝 Docker Hub description will be updated - 4. 🧹 Release branch will be cleaned up automatically - - Auto-merge Information - This PR can be safely merged as it only contains version updates. - - **⚠️ Important:** Once merged, this will immediately publish Docker images to production registries. - - --- - *🤖 Fully automated release - zero manual intervention required!* diff --git a/.github/workflows/AUTO-VERSION.yml b/.github/workflows/AUTO-VERSION.yml deleted file mode 100644 index af464ae..0000000 --- a/.github/workflows/AUTO-VERSION.yml +++ /dev/null @@ -1,207 +0,0 @@ -name: Auto-Version Release - -on: - push: - branches: - - master - paths-ignore: - - 'README.md' - - '.github/WORKFLOWS.md' - - '.github/VERSION-DETECTION.md' - - 'LICENSE' - - '*.md' - workflow_dispatch: - inputs: - release_type: - description: 'Type of release (auto-detects from commits if not specified)' - required: false - default: 'auto' - type: choice - options: - - auto - - patch - - minor - - major - -jobs: - check_for_release: - name: Check if Release Needed - runs-on: ubuntu-24.04-arm - outputs: - should_release: ${{ steps.check.outputs.should_release }} - version_type: ${{ steps.check.outputs.version_type }} - new_version: ${{ steps.check.outputs.new_version }} - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Check for release triggers - id: check - run: | - # Get the latest tag - LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0") - echo "Latest tag: $LATEST_TAG" - - # Get commits since last tag - COMMITS_SINCE_TAG=$(git rev-list ${LATEST_TAG}..HEAD --count) - echo "Commits since last tag: $COMMITS_SINCE_TAG" - - # If no new commits, don't release - if [ "$COMMITS_SINCE_TAG" -eq 0 ]; then - echo "No new commits since last tag" - echo "should_release=false" >> $GITHUB_OUTPUT - exit 0 - fi - - # Get branch names that were merged since last tag - MERGED_BRANCHES=$(git log ${LATEST_TAG}..HEAD --merges --pretty=format:"%s" | grep -o "from [^']*" | sed 's/from //' || echo "") - echo "Merged branches since last tag:" - echo "$MERGED_BRANCHES" - - # Also check commit messages for manual detection - COMMIT_MESSAGES=$(git log ${LATEST_TAG}..HEAD --pretty=format:"%s" --max-count=50) - if [ $? -ne 0 ]; then - echo "Error: Failed to retrieve commit messages for range ${LATEST_TAG}..HEAD" >&2 - exit 1 - fi - echo "Commit messages:" - echo "$COMMIT_MESSAGES" - - # Skip release for dependency and docs updates - if echo "$MERGED_BRANCHES" | grep -iE "^dep|^dependabot|^docs|^release|/dep|/docs|/release"; then - echo "Skipping release for dependency/docs/release updates" - echo "should_release=false" >> $GITHUB_OUTPUT - exit 0 - fi - - if echo "$COMMIT_MESSAGES" | grep -iE "^dep:|^docs:|^dependencies:|^dependency:|^release:|update.*dependenc|bump.*version"; then - echo "Skipping release for dependency/docs/version update commits" - echo "should_release=false" >> $GITHUB_OUTPUT - exit 0 - fi - - # Skip if this is already a release commit to prevent infinite loops - if echo "$COMMIT_MESSAGES" | grep -E "^🤖 Fully Automated Release|^🤖 Automated Release"; then - echo "Skipping release for release commits to prevent loops" - echo "should_release=false" >> $GITHUB_OUTPUT - exit 0 - fi - - # Determine version type - VERSION_TYPE="${{ github.event.inputs.release_type }}" - if [ "$VERSION_TYPE" = "auto" ] || [ -z "$VERSION_TYPE" ]; then - # Check for feat branches first (minor version bump - Y) - if echo "$MERGED_BRANCHES" | grep -iE "^feat|/feat"; then - VERSION_TYPE="minor" - # Check for feat in commit messages as fallback - elif echo "$COMMIT_MESSAGES" | grep -iE "^feat:|feat\(.*\):|^feature:"; then - VERSION_TYPE="minor" - # Check for breaking changes (should be major, but we'll be conservative and use minor) - elif echo "$COMMIT_MESSAGES" | grep -iE "BREAKING CHANGE|breaking:|^break:"; then - VERSION_TYPE="minor" - # Everything else is patch (Z) - else - VERSION_TYPE="patch" - fi - fi - - echo "Detected version type: $VERSION_TYPE" - - # Calculate new version with validation - CURRENT_VERSION=${LATEST_TAG#v} - if [[ ! $CURRENT_VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then - echo "Error: Invalid current version format: $CURRENT_VERSION" >&2 - exit 1 - fi - - IFS='.' read -ra VERSION_PARTS <<< "$CURRENT_VERSION" - MAJOR=${VERSION_PARTS[0]:-0} - MINOR=${VERSION_PARTS[1]:-0} - PATCH=${VERSION_PARTS[2]:-0} - - case $VERSION_TYPE in - major) - NEW_VERSION="v$((MAJOR + 1)).0.0" - ;; - minor) - NEW_VERSION="v${MAJOR}.$((MINOR + 1)).0" - ;; - patch) - NEW_VERSION="v${MAJOR}.${MINOR}.$((PATCH + 1))" - ;; - *) - echo "Error: Invalid version type: $VERSION_TYPE" >&2 - exit 1 - ;; - esac - - echo "New version: $NEW_VERSION" - - # Validate new version doesn't already exist - if git tag -l | grep -q "^${NEW_VERSION}$"; then - echo "Error: Version $NEW_VERSION already exists" >&2 - exit 1 - fi - - # Set outputs - echo "should_release=true" >> $GITHUB_OUTPUT - echo "version_type=$VERSION_TYPE" >> $GITHUB_OUTPUT - echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT - - create_release: - name: Create Automated Release - needs: check_for_release - if: needs.check_for_release.outputs.should_release == 'true' - runs-on: ubuntu-24.04-arm - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Update version in action.yml - run: | - VERSION="${{ needs.check_for_release.outputs.new_version }}" - sed -i "s|image: docker://devopsinfra/action-commit-push:.*|image: docker://devopsinfra/action-commit-push:${VERSION}|" action.yml - echo "✅ Updated action.yml to use version: ${VERSION}" - - - name: Update version in Makefile - run: | - VERSION="${{ needs.check_for_release.outputs.new_version }}" - sed -i "s|echo \"v[0-9]\+\.[0-9]\+\.[0-9]\+\"|echo \"${VERSION}\"|" Makefile - echo "✅ Updated Makefile fallback version to: ${VERSION}" - - - name: Create release branch and commit changes - uses: devops-infra/action-commit-push@v0.11.1 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - target_branch: release/${{ needs.check_for_release.outputs.new_version }} - commit_message: | - 🤖 Fully Automated Release ${{ needs.check_for_release.outputs.new_version }} - - This release was **automatically created** and requires **no manual intervention**. - - 📊 Release Details - - **Version**: `${{ needs.check_for_release.outputs.new_version }}` - - **Type**: `${{ needs.check_for_release.outputs.version_type }}` (auto-detected) - - **Trigger**: `${{ github.event_name }}` - - **Actor**: @${{ github.actor }} - - **Date**: $(date +'%Y-%m-%d %H:%M:%S UTC') - - 🚀 What happens when merged? - 1. 🐳 Multi-architecture Docker images built and pushed - 2. 🏷️ GitHub release created with auto-generated notes - 3. 📝 Docker Hub description updated - 4. 🧹 Release branch automatically cleaned up - - 🔍 Version Detection Logic - - `major`: Manual releases only (v0.10.2 → v1.0.0) - - `minor`: Merges from feat* branches or feat: in commits (v0.10.2 → v0.11.0) - - `patch`: All other changes (v0.10.2 → v0.10.3) - - **This PR is safe to auto-merge - it only contains version updates.** - - --- - *🤖 Fully automated release - zero manual intervention required!* diff --git a/.github/workflows/CRON.yml b/.github/workflows/CRON.yml deleted file mode 100644 index af3303d..0000000 --- a/.github/workflows/CRON.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Weekly test build & push - -on: - schedule: - # Run every week at 5.00 AM UTC - - cron: "0 5 */7 * *" - -jobs: - build_and_push_test: - name: Weekly test build & push - runs-on: ubuntu-24.04-arm - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Docker Buildx - uses: docker/setup-buildx-action@v3.11.1 - with: - install: true - - - name: QEMU - uses: docker/setup-qemu-action@v3.6.0 - with: - image: tonistiigi/binfmt:latest - platforms: amd64,arm64 - - - name: Build & push test image - env: - DOCKER_BUILDKIT: 1 - DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - TERM: xterm-256color - run: make push VERSION_PREFIX=test- diff --git a/.github/workflows/PUSH-MASTER.yml b/.github/workflows/PUSH-MASTER.yml deleted file mode 100644 index a5f425f..0000000 --- a/.github/workflows/PUSH-MASTER.yml +++ /dev/null @@ -1,63 +0,0 @@ -name: Push to master - -on: - push: - branches: - - master - -jobs: - labels: - name: Repo labels - runs-on: ubuntu-24.04-arm - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Labels' config - shell: bash - run: | - mkdir -p .tmp - curl -LsS https://raw.githubusercontent.com/devops-infra/.github/master/.github/labels.yml -o .tmp/labels.yml - - - name: Update labels - uses: crazy-max/ghaction-github-labeler@v5.3.0 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - yaml-file: .tmp/labels.yml - - lint: - name: Linters - runs-on: ubuntu-24.04-arm - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Hadolint - uses: hadolint/hadolint-action@v3.1.0 - with: - dockerfile: Dockerfile - - build_test: - name: Build test - needs: lint - runs-on: ubuntu-24.04-arm - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Docker Buildx - uses: docker/setup-buildx-action@v3.11.1 - with: - install: true - - - name: QEMU - uses: docker/setup-qemu-action@v3.6.0 - with: - image: tonistiigi/binfmt:latest - platforms: amd64,arm64 - - - name: Build test - env: - DOCKER_BUILDKIT: 1 - TERM: xterm-256color - run: make build diff --git a/.github/workflows/PUSH-OTHER.yml b/.github/workflows/PUSH-OTHER.yml deleted file mode 100644 index 8912ede..0000000 --- a/.github/workflows/PUSH-OTHER.yml +++ /dev/null @@ -1,179 +0,0 @@ -name: Push to other branches - -on: - push: - branches-ignore: - - master - -jobs: - labels: - name: Repo labels - runs-on: ubuntu-24.04-arm - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Labels' config - shell: bash - run: | - mkdir -p .tmp - curl -LsS https://raw.githubusercontent.com/devops-infra/.github/master/.github/labels.yml -o .tmp/labels.yml - - - name: Update labels (dry run) - uses: crazy-max/ghaction-github-labeler@v5.3.0 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - yaml-file: .tmp/labels.yml - dry-run: true - - lint: - name: Linters - if: ${{ !startsWith(github.ref, 'refs/heads/dependabot') }} - runs-on: ubuntu-24.04-arm - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Hadolint - uses: hadolint/hadolint-action@v3.1.0 - with: - dockerfile: Dockerfile - - build_test: - name: Build test - if: ${{ !startsWith(github.ref, 'refs/heads/dependabot') && !startsWith(github.ref, 'refs/heads/test') && !startsWith(github.ref, 'refs/heads/release') }} - runs-on: ubuntu-24.04-arm - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Docker Buildx - uses: docker/setup-buildx-action@v3.11.1 - with: - install: true - - - name: QEMU - uses: docker/setup-qemu-action@v3.6.0 - with: - image: tonistiigi/binfmt:latest - platforms: amd64,arm64 - - - name: Build test - env: - DOCKER_BUILDKIT: 1 - TERM: xterm-256color - run: make build - - build_and_push_test: - name: Build & push test image - if: ${{ startsWith(github.ref, 'refs/heads/test') }} - runs-on: ubuntu-24.04-arm - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Docker Buildx - uses: docker/setup-buildx-action@v3.11.1 - with: - install: true - - - name: QEMU - uses: docker/setup-qemu-action@v3.6.0 - with: - image: tonistiigi/binfmt:latest - platforms: amd64,arm64 - - - name: Build & push test image - env: - DOCKER_BUILDKIT: 1 - DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - TERM: xterm-256color - run: make push VERSION_PREFIX=test- - - pull_request: - name: Create Pull Request - runs-on: ubuntu-24.04-arm - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Template - shell: bash - run: | - mkdir -p .tmp - curl -LsS https://raw.githubusercontent.com/devops-infra/.github/master/PULL_REQUEST_TEMPLATE.md -o .tmp/PULL_REQUEST_TEMPLATE.md - - - name: PR - bugfix (conditional) - if: startsWith(github.ref, 'refs/heads/bug') || startsWith(github.ref, 'refs/heads/fix') || startsWith(github.ref, 'refs/heads/hotfix') - uses: devops-infra/action-pull-request@v0.6.0 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - assignee: ${{ github.actor }} - label: bugfix - template: .tmp/PULL_REQUEST_TEMPLATE.md - get_diff: true - - - name: PR - dependency (conditional) - if: startsWith(github.ref, 'refs/heads/dep') && !startsWith(github.ref, 'refs/heads/dependabot') - uses: devops-infra/action-pull-request@v0.6.0 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - assignee: ${{ github.actor }} - label: dependency - template: .tmp/PULL_REQUEST_TEMPLATE.md - get_diff: true - - - name: PR - documentation (conditional) - if: startsWith(github.ref, 'refs/heads/doc') - uses: devops-infra/action-pull-request@v0.6.0 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - assignee: ${{ github.actor }} - label: documentation - template: .tmp/PULL_REQUEST_TEMPLATE.md - get_diff: true - - - name: PR - feature (conditional) - if: startsWith(github.ref, 'refs/heads/feat') - uses: devops-infra/action-pull-request@v0.6.0 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - assignee: ${{ github.actor }} - label: feature - template: .tmp/PULL_REQUEST_TEMPLATE.md - get_diff: true - - - name: PR - test (conditional) - if: startsWith(github.ref, 'refs/heads/test') - uses: devops-infra/action-pull-request@v0.6.0 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - assignee: ${{ github.actor }} - reviewer: ${{ github.actor }} - label: test - template: .tmp/PULL_REQUEST_TEMPLATE.md - draft: true - get_diff: true - - - name: PR - release (conditional) - if: startsWith(github.ref, 'refs/heads/release') - uses: devops-infra/action-pull-request@v0.6.0 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - assignee: ${{ github.actor }} - label: release - template: .tmp/PULL_REQUEST_TEMPLATE.md - get_diff: true - - - name: PR - other branches (conditional) - if: ${{ !(startsWith(github.ref, 'refs/heads/bug') || startsWith(github.ref, 'refs/heads/fix') || startsWith(github.ref, 'refs/heads/hotfix') || startsWith(github.ref, 'refs/heads/dep') || startsWith(github.ref, 'refs/heads/doc') || startsWith(github.ref, 'refs/heads/feat') || startsWith(github.ref, 'refs/heads/test') || startsWith(github.ref, 'refs/heads/release')) }} - uses: devops-infra/action-pull-request@v0.6.0 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - assignee: ${{ github.actor }} - label: feature - template: .tmp/PULL_REQUEST_TEMPLATE.md - get_diff: true diff --git a/.github/workflows/RELEASE.yml b/.github/workflows/RELEASE.yml deleted file mode 100644 index 31cbfd5..0000000 --- a/.github/workflows/RELEASE.yml +++ /dev/null @@ -1,183 +0,0 @@ -name: Release - -# Trigger on pushes to release/vX.Y.Z branches to create release PRs -# Trigger on PR merges from release/vX.Y.Z branches to publish release images -on: - push: - branches: - - 'release/v*' - pull_request: - types: [closed] - branches: - - master - -jobs: - create_release_pr: - name: Create Release PR - # Only run on push to release/vX.Y.Z branches - if: github.event_name == 'push' && startsWith(github.ref, 'refs/heads/release/v') - runs-on: ubuntu-24.04-arm - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Extract version from branch name - id: version - run: | - BRANCH_NAME=${GITHUB_REF#refs/heads/} - VERSION=${BRANCH_NAME#release/} - echo "version=${VERSION}" >> $GITHUB_OUTPUT - echo "branch=${BRANCH_NAME}" >> $GITHUB_OUTPUT - echo "Version: ${VERSION}" - echo "Branch: ${BRANCH_NAME}" - - - name: Update action.yml with new version - run: | - VERSION=${{ steps.version.outputs.version }} - sed -i "s|image: docker://devopsinfra/action-commit-push:.*|image: docker://devopsinfra/action-commit-push:${VERSION}|" action.yml - echo "Updated action.yml to use version: ${VERSION}" - - - name: Update Makefile with new version - run: | - VERSION=${{ steps.version.outputs.version }} - # Update the fallback version in Makefile - sed -i "s|echo \"v[0-9]\+\.[0-9]\+\.[0-9]\+\"|echo \"${VERSION}\"|" Makefile - echo "Updated Makefile fallback version to: ${VERSION}" - - - name: Create Release Pull Request - uses: devops-infra/action-pull-request@v0.6.0 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - title: "🚀 Release ${{ steps.version.outputs.version }}" - body: | - ## Release ${{ steps.version.outputs.version }} - - This PR prepares a new release version ${{ steps.version.outputs.version }}. - - ### Changes in this release - - Updated `action.yml` to reference Docker image `${{ steps.version.outputs.version }}` - - Updated `Makefile` fallback version to `${{ steps.version.outputs.version }}` - - ### What happens when this PR is merged? - 1. ✅ Docker images will be built and pushed to Docker Hub and GitHub Packages - 2. ✅ A GitHub release will be created with tag `${{ steps.version.outputs.version }}` - 3. ✅ Docker Hub description will be updated - - ### Review Checklist - - [ ] Version number is correct - - [ ] CHANGELOG.md is updated (if applicable) - - [ ] Breaking changes are documented - - [ ] All tests pass - - **⚠️ Important:** Once merged, this will immediately publish Docker images to production registries. - target_branch: master - source_branch: ${{ steps.version.outputs.branch }} - label: release - - build_and_publish: - name: Build & Publish Release - # Only run when PR from release/vX.Y.Z branch is merged to master - if: | - github.event_name == 'pull_request' && - github.event.pull_request.merged == true && - startsWith(github.event.pull_request.head.ref, 'release/v') - runs-on: ubuntu-24.04-arm - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Docker Buildx - uses: docker/setup-buildx-action@v3.11.1 - with: - install: true - - - name: QEMU - uses: docker/setup-qemu-action@v3.6.0 - with: - image: tonistiigi/binfmt:latest - platforms: amd64,arm64 - - - name: Extract version from PR branch - id: version - run: | - BRANCH_NAME="${{ github.event.pull_request.head.ref }}" - VERSION=${BRANCH_NAME#release/} - echo "version=${VERSION}" >> $GITHUB_OUTPUT - echo "Version: ${VERSION}" - - - name: Build & push release - env: - DOCKER_BUILDKIT: 1 - DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - TERM: xterm-256color - VERSION: ${{ steps.version.outputs.version }} - run: | - echo "Building and pushing Docker images for version: $VERSION" - make push || { - echo "❌ Docker build/push failed" - exit 1 - } - echo "✅ Docker images built and pushed successfully" - - - name: Create GitHub Release - uses: softprops/action-gh-release@v2.3.2 - with: - tag_name: ${{ steps.version.outputs.version }} - name: ${{ steps.version.outputs.version }} - body: | - ## Release ${{ steps.version.outputs.version }} - - ### 🚀 Usage - ```yaml - - uses: devops-infra/action-commit-push@${{ steps.version.outputs.version }} - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - commit_message: "Your commit message" - ``` - - ### 📦 Docker Images - - `docker://devopsinfra/action-commit-push:${{ steps.version.outputs.version }}` - - `docker://devopsinfra/action-commit-push:latest` - - ### 🏗️ Architecture Support - - `linux/amd64` - - `linux/arm64` - generate_release_notes: true - draft: false - prerelease: false - - - name: Docker Hub Description - uses: peter-evans/dockerhub-description@v4.0.2 - with: - username: ${{ vars.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_TOKEN }} - repository: ${{ vars.DOCKER_ORG_NAME }}/${{ github.event.repository.name }} - short-description: ${{ github.event.repository.description }} - - - name: Clean up release branch - run: | - RELEASE_BRANCH="${{ github.event.pull_request.head.ref }}" - echo "Attempting to clean up release branch: $RELEASE_BRANCH" - - # Check if the release branch exists before attempting to delete it - if git ls-remote --exit-code --heads origin "$RELEASE_BRANCH" >/dev/null 2>&1; then - echo "✅ Branch $RELEASE_BRANCH exists on remote, deleting..." - git push origin --delete "$RELEASE_BRANCH" || { - echo "⚠️ Warning: Failed to delete remote branch $RELEASE_BRANCH" - echo "This is not critical - the branch can be cleaned up manually" - } - echo "✅ Remote branch $RELEASE_BRANCH deleted successfully" - else - echo "ℹ️ Branch $RELEASE_BRANCH does not exist on remote (may have been auto-deleted)" - fi - - # Also try to clean up any local reference - if git show-ref --verify --quiet "refs/heads/$RELEASE_BRANCH"; then - echo "🧹 Cleaning up local branch reference..." - git branch -D "$RELEASE_BRANCH" 2>/dev/null || true - fi - - echo "✅ Branch cleanup completed" diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml new file mode 100644 index 0000000..134132a --- /dev/null +++ b/.github/workflows/pull-request.yml @@ -0,0 +1,86 @@ +name: Pull Request + +on: + push: + branches-ignore: + - master + - 'dependabot**' + - 'test**' + +jobs: + lint: + name: Lint + if: ${{ !startsWith(github.ref, 'refs/heads/dependabot') }} + runs-on: ubuntu-24.04-arm + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Hadolint + uses: hadolint/hadolint-action@v3.1.0 + with: + dockerfile: Dockerfile + + build_test: + name: Push test + runs-on: ubuntu-24.04-arm + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Extract branch name + id: branch + run: | + if [ "${{ github.event_name }}" == "pull_request" ]; then + BRANCH_NAME="${{ github.head_ref }}" + else + BRANCH_NAME="${GITHUB_REF#refs/heads/}" + fi + # Sanitize branch name for Docker tag (replace special chars with -) + SANITIZED_BRANCH=$(echo "$BRANCH_NAME" | sed 's/[^a-zA-Z0-9._-]/-/g' | tr '[:upper:]' '[:lower:]') + echo "name=$SANITIZED_BRANCH" >> $GITHUB_OUTPUT + echo "Branch name: $BRANCH_NAME -> Docker tag: test-$SANITIZED_BRANCH" + + - name: Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + install: true + + - name: QEMU + uses: docker/setup-qemu-action@v3 + with: + image: tonistiigi/binfmt:latest + platforms: amd64,arm64 + + - name: Build and push test image + env: + DOCKER_BUILDKIT: 1 + DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + VERSION: ${{ steps.branch.outputs.name }} + VERSION_PREFIX: test- + TERM: xterm-256color + run: make push + + pull_request: + name: Pull Request + runs-on: ubuntu-24.04-arm + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Template + shell: bash + run: | + mkdir -p .tmp + curl -LsS https://raw.githubusercontent.com/devops-infra/.github/master/PULL_REQUEST_TEMPLATE.md -o .tmp/PULL_REQUEST_TEMPLATE.md + + - name: Create Pull Request + uses: devops-infra/action-pull-request@v0.6.0 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + assignee: ${{ github.actor }} + template: .tmp/PULL_REQUEST_TEMPLATE.md + get_diff: true \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..dac97bd --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,76 @@ +name: Manual Release + +on: + workflow_dispatch: + inputs: + version: + description: 'Release version (e.g., v1.2.3)' + required: true + type: string + +jobs: + release: + name: Create Release + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Validate version format + run: | + VERSION="${{ github.event.inputs.version }}" + if [[ ! $VERSION =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo "❌ Invalid version format. Use format: v1.2.3" + exit 1 + fi + echo "✅ Version format is valid: $VERSION" + + - name: Check if version already exists + run: | + VERSION="${{ github.event.inputs.version }}" + if git tag -l | grep -q "^${VERSION}$"; then + echo "❌ Version $VERSION already exists" + exit 1 + fi + echo "✅ Version $VERSION is available" + + - name: Create and push tag + run: | + VERSION="${{ github.event.inputs.version }}" + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git tag -a "$VERSION" -m "Release $VERSION" + git push origin "$VERSION" + + - name: Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + install: true + + - name: QEMU + uses: docker/setup-qemu-action@v3 + with: + image: tonistiigi/binfmt:latest + platforms: amd64,arm64 + + - name: Build and push Docker images + env: + DOCKER_BUILDKIT: 1 + DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + VERSION: ${{ github.event.inputs.version }} + TERM: xterm-256color + run: make push + + - name: Create GitHub Release + uses: softprops/action-gh-release@v2.3.2 + with: + tag_name: ${{ github.event.inputs.version }} + name: Release ${{ github.event.inputs.version }} + draft: false + prerelease: false + generate_release_notes: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/weekly-dependency-check.yml b/.github/workflows/weekly-dependency-check.yml new file mode 100644 index 0000000..e7f344e --- /dev/null +++ b/.github/workflows/weekly-dependency-check.yml @@ -0,0 +1,68 @@ +name: Weekly Dependency Check + +on: + schedule: + # Run every Sunday at 02:00 UTC + - cron: '0 2 * * 0' + workflow_dispatch: # Allow manual trigger + +jobs: + dependency-check: + name: Test Dependencies + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + ref: 'master' + fetch-depth: 0 + + - name: Get latest release tag + id: latest-tag + run: | + LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null) + if [ -z "$LATEST_TAG" ]; then + echo "❌ No release tags found in repository" + echo "Please create at least one release before running dependency checks" + exit 1 + fi + echo "tag=$LATEST_TAG" >> $GITHUB_OUTPUT + echo "Testing dependencies for tag: $LATEST_TAG" + + - name: Checkout latest release + run: | + git checkout ${{ steps.latest-tag.outputs.tag }} + + - name: Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + install: true + + - name: QEMU + uses: docker/setup-qemu-action@v3 + with: + image: tonistiigi/binfmt:latest + platforms: amd64,arm64 + + - name: Test build and push + env: + DOCKER_BUILDKIT: 1 + DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + VERSION: test-${{ steps.latest-tag.outputs.tag }} + VERSION_PREFIX: test- + TERM: xterm-256color + run: make push + + - name: Notify on failure + if: failure() + uses: actions/github-script@v7.0.1 + with: + script: | + github.rest.issues.create({ + owner: context.repo.owner, + repo: context.repo.repo, + title: `Weekly dependency check failed for ${context.payload.inputs?.tag || '${{ steps.latest-tag.outputs.tag }}'}`, + body: `The weekly dependency check failed when building from tag ${{ steps.latest-tag.outputs.tag }}.\n\nPlease check the [workflow run](https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}) for details.`, + labels: ['bug', 'dependencies'] + }) diff --git a/Makefile b/Makefile index f57fdf1..3b54d79 100644 --- a/Makefile +++ b/Makefile @@ -13,11 +13,11 @@ VERSION_PREFIX ?= CURRENT_BRANCH := $(shell echo $(GITHUB_REF) | sed 's/refs\/heads\///') GITHUB_SHORT_SHA := $(shell echo $(GITHUB_SHA) | cut -c1-7) RELEASE_BRANCH := master -DOCKER_USERNAME := christophshyper -DOCKER_ORG_NAME := devopsinfra +DOCKER_USERNAME := $(or $(DOCKER_USERNAME),christophshyper) +DOCKER_ORG_NAME := $(or $(DOCKER_ORG_NAME),devopsinfra) DOCKER_IMAGE := action-commit-push DOCKER_NAME := $(DOCKER_ORG_NAME)/$(DOCKER_IMAGE) -GITHUB_USERNAME := ChristophShyper +GITHUB_USERNAME := $(or $(GITHUB_USERNAME),ChristophShyper) GITHUB_ORG_NAME := devops-infra GITHUB_NAME := ghcr.io/$(GITHUB_ORG_NAME)/$(DOCKER_IMAGE) BUILD_DATE := $(shell date -u +"%Y-%m-%dT%H:%M:%SZ") diff --git a/action.yml b/action.yml index c8b9460..9241d52 100644 --- a/action.yml +++ b/action.yml @@ -49,7 +49,7 @@ outputs: description: Name of the branch code was pushed into runs: using: docker - image: docker://devopsinfra/action-commit-push:v0.11.1 + image: docker://devopsinfra/action-commit-push:latest env: GITHUB_TOKEN: ${{ inputs.github_token }} branding: From e0ec752157a07744e48249f436c7d874bd50472e Mon Sep 17 00:00:00 2001 From: ChristophShyper <45788587+ChristophShyper@users.noreply.github.com> Date: Tue, 12 Aug 2025 23:30:29 +0200 Subject: [PATCH 2/2] Sync with old behavior --- .github/VERSION-DETECTION.md | 120 -------------- .github/WORKFLOWS.md | 146 ------------------ .github/workflows/pull-request.yml | 9 +- .github/workflows/release.yml | 4 +- .github/workflows/weekly-dependency-check.yml | 31 +--- 5 files changed, 11 insertions(+), 299 deletions(-) delete mode 100644 .github/VERSION-DETECTION.md delete mode 100644 .github/WORKFLOWS.md diff --git a/.github/VERSION-DETECTION.md b/.github/VERSION-DETECTION.md deleted file mode 100644 index 7998410..0000000 --- a/.github/VERSION-DETECTION.md +++ /dev/null @@ -1,120 +0,0 @@ -# Version Detection Test Examples - -This file demonstrates how the automated version detection works with different branch merges and commit patterns. - -## Branch-Based Version Detection - -### ✅ Minor Version Bump (v0.10.2 → v0.11.0) -**Trigger**: Merging from `feat*` branches or commits with `feat:` prefix - -```bash -# Feature branch workflow: -git checkout master -git checkout -b feat/new-user-authentication -git commit -m "feat: add OAuth login support" -git commit -m "feat: add user profile management" -git push origin feat/new-user-authentication - -# Create PR and merge to master -# Result: Automatic minor version bump v0.10.2 → v0.11.0 -``` - -### ✅ Patch Version Bump (v0.10.2 → v0.10.3) -**Trigger**: Merging from any other branch or non-feature commits - -```bash -# Bug fix: -git checkout -b fix/login-timeout -git commit -m "fix: resolve session timeout issue" -# Result: v0.10.2 → v0.10.3 - -# Documentation: -git checkout -b docs/update-api-guide -git commit -m "docs: update API documentation" -# Result: skipped - docs don't trigger releases - -# Refactoring: -git checkout -b refactor/cleanup-auth -git commit -m "refactor: simplify authentication flow" -# Result: v0.10.2 → v0.10.3 -``` - -## 🚫 Skipped Releases - -The system automatically skips releases for: - -- **Dependency updates**: Branches starting with `dep*` or `dependabot*` -- **Documentation**: Branches starting with `docs*` or commits with `docs:` -- **Release commits**: Prevents infinite loops from release automation -- **Version bumps**: Updates to dependencies or version files - -```bash -# These will NOT trigger releases: -git checkout -b deps/update-actions -git commit -m "deps: update GitHub Actions to latest" - -git checkout -b docs/fix-readme -git commit -m "docs: fix typos in README" - -# Direct commits to master with these patterns also skip releases -``` - -## Detection Priority & Logic - -The system checks in this order: - -1. **Skip conditions** (highest priority) - - Dependency/docs/release branch patterns - - Dependency/docs/release commit message patterns - - Existing release commit patterns (prevents loops) - -2. **Feature detection** (second priority) - - Merged branch names matching `feat*` pattern - - Commit messages with `feat:`, `feat():`, or `feature:` prefix - - Breaking change indicators (treated as minor for safety) - - Results in minor version bump (Y) - -3. **Everything else** (default) - - All other branch merges and commits - - Results in patch version bump (Z) - -## Enhanced Example Scenarios - -| Branch Name | Commit Message | Result | Reason | -|-----------------|------------------------------|-------------------|---------------------------------| -| `feat/auth` | "feat: add login system" | v0.10.2 → v0.11.0 | Feature branch + feat commit | -| `fix/bug` | "fix: resolve crash" | v0.10.2 → v0.10.3 | Non-feature branch | -| `docs/readme` | "docs: update guide" | **Skipped** | Documentation update | -| `deps/actions` | "deps: update actions" | **Skipped** | Dependency update | -| `fix/bug` | "feat: add new feature" | v0.10.2 → v0.11.0 | feat in commit message | -| `refactor/code` | "BREAKING CHANGE: new API" | v0.10.2 → v0.11.0 | Breaking change (conservative) | -| `any-branch` | "🤖 Fully Automated Release" | **Skipped** | Release commit (prevents loops) | - -## Advanced Features - -### 🔄 **Infinite Loop Prevention** -- Detects its own release commits and skips them -- Prevents cascading releases from automation - -### 🎯 **Smart Branch Analysis** -- Analyzes both branch names and commit messages -- Handles various conventional commit formats -- Conservative approach to breaking changes - -### ✅ **Validation & Safety** -- Validates version format before processing -- Checks for existing tags to prevent duplicates -- Provides detailed logging for debugging - -### 🔧 **Manual Override** -- Supports manual workflow dispatch -- Allows override of auto-detection logic -- Useful for emergency releases or major versions - -This ensures that: -- ✅ Major version (X) requires manual intervention for safety -- ✅ New features always increment minor version (Y number) -- ✅ Bug fixes and other changes increment patch version (Z number) -- ✅ Documentation and dependency updates don't clutter releases -- ✅ No manual version management needed for regular development -- ✅ Robust protection against automation loops diff --git a/.github/WORKFLOWS.md b/.github/WORKFLOWS.md deleted file mode 100644 index fbf6070..0000000 --- a/.github/WORKFLOWS.md +++ /dev/null @@ -1,146 +0,0 @@ -# GitHub Actions Workflows Documentation - -This repository uses: Fully automated release creation with zero manual intervention -- ✅ Detects when releases are needed (new commits to master, excluding docs/deps) -- ✅ Analyzes commit messages for semantic versioning -- ✅ Calculates next version automatically (major/minor) -- ✅ Creates release branches with version updates using own action -- ✅ Relies on PUSH-OTHER.yml for PR creation -- ✅ Supports manual triggering for custom releases -- ✅ Skips releases for documentation and dependency updates - -This repository uses a comprehensive GitHub Actions setup with different workflows for different purposes. -## Workflow Overview - -### 1. PUSH-MASTER.yml -**Trigger**: Push to `master` branch - -**Purpose**: Continuous Integration for master branch -- ✅ Update repository labels -- ✅ Run Hadolint linting on Dockerfile -- ✅ Build Docker image (test only, no push) - -**Actions**: -- Labels management -- Dockerfile linting -- Docker build test - -### 2. PUSH-OTHER.yml -**Trigger**: Push to any branch except `master` - -**Purpose**: Continuous Integration for feature branches -- ✅ Update repository labels (dry run) -- ✅ Run Hadolint linting on Dockerfile -- ✅ Build Docker image (test only for regular branches) -- ✅ Build & push test Docker images for `test*` branches -- ✅ Create Pull Requests based on branch naming conventions - -**Special handling for test branches**: -- Branches starting with `test` → Build and push Docker images with `test-` prefix -- Other branches → Build test only (no push) - -**Branch naming conventions for auto-PR creation**: -- `bug*` → Creates PR with "bugfix" label -- `dep*` → Creates PR with "dependency" label -- `doc*` → Creates PR with "documentation" label -- `feat*` → Creates PR with "feature" label -- `test*` → Creates draft PR with "test" label + pushes test Docker images -- Other branches → Creates PR with "feature" label - -### 3. RELEASE.yml -**Trigger**: -- Push to `release/vX.Y.Z` branches (creates release PR) -- Pull request merge from `release/vX.Y.Z` branches to master (publishes release) - -**Purpose**: Handle release branch workflows and Docker image publishing -- ✅ Create release PRs with version updates when pushing to `release/vX.Y.Z` branches -- ✅ Build multi-architecture Docker images (amd64, arm64) when release PRs are merged -- ✅ Push images to Docker Hub with release version tag and `latest` -- ✅ Push images to GitHub Container Registry -- ✅ Create GitHub release with version tag -- ✅ Update Docker Hub description -- ✅ Clean up release branch after merge - -### 4. AUTO-VERSION.yml -**Trigger**: -- Push to `master` branch (automatic) -- Manual workflow dispatch (optional) - -**Purpose**: Fully automated release creation with zero manual intervention -- ✅ Detects when releases are needed (new commits to master) -- ✅ Analyzes commit messages for semantic versioning -- ✅ Calculates next version automatically (major/minor/patch) -- ✅ Creates release branches with version updates -- ✅ Opens detailed release PRs -- ✅ Supports manual triggering for custom releases - -**Automated Release Process**: -1. New commits pushed to master (excluding docs/dependencies) -2. System analyzes merged branch names and commit messages: - - Merged from "feat" branches → minor version (v0.10.2 → v0.11.0) - - Other changes → patch version (v0.10.2 → v0.10.3) -3. Automatically creates `release/vX.Y.Z` branch using own action -4. Updates version in `action.yml` and `Makefile` -5. PUSH-OTHER.yml workflow creates PR automatically -6. When merged → triggers RELEASE.yml workflow for publishing - -### 5. AUTO-RELEASE.yml -**Trigger**: Manual workflow dispatch only - -**Purpose**: Manual release creation with version input -- ✅ Allows manual specification of release version -- ✅ Supports minor/major release types -- ✅ Creates release branches using own action -- ✅ Relies on PUSH-OTHER.yml for PR creation -- ✅ Validates version format and availability - -### 6. CRON.yml -**Trigger**: Weekly schedule (Sundays at 5:00 AM UTC) - -**Purpose**: Weekly health check and test image refresh -- ✅ Build Docker image to ensure dependencies still work -- ✅ Push test images to keep them fresh for testing -- ✅ Test that the build process is still functional - -## Security & Best Practices - -### Required Secrets -- `GITHUB_TOKEN`: Automatically provided by GitHub Actions -- `DOCKER_TOKEN`: Docker Hub access token for pushing images - -### Required Variables -- `DOCKER_USERNAME`: Docker Hub username -- `DOCKER_ORG_NAME`: Docker Hub organization name - -### Key Features -- **Multi-architecture support**: Builds for both `amd64` and `arm64` -- **Dependency updates**: Uses Dependabot for automated dependency updates -- **Security scanning**: Hadolint for Dockerfile best practices -- **Release automation**: Automatic Docker image versioning and deployment -- **Development safety**: Prevents accidental production deployments from development branches - -## Deployment Strategy - -### Development Flow -1. Create feature branch with appropriate naming convention -2. Push changes → Triggers build test and auto-PR creation -3. Review and merge PR to master → Triggers automatic release detection -4. System automatically creates release (if new commits warrant it) -5. Review and merge release PR → Triggers production deployment - -### Production Deployment -- **Fully automated**: No manual release creation needed -- **Smart detection**: Only releases when there are actual changes -- **Semantic versioning**: Automatic version calculation from commit messages -- **Safe process**: Release PRs provide review opportunity before publishing -- **GitHub release creation**: Automated with release notes -- **Docker Hub and GitHub Container Registry**: Automatic multi-architecture deployment - -### Release Automation Strategy -- **Zero manual work**: Push to master → automatic release detection → release PR → merge → publish -- **Semantic commits**: Commit message analysis determines version type -- **Branch protection**: All releases go through PR review process -- **Failsafe mechanisms**: Version validation, duplicate prevention, format checking -- **Clean automation**: Automatic branch cleanup and proper tagging - -This setup provides **complete automation** while maintaining safety through the PR review process. No manual release management required! diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 134132a..4dadabf 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -5,12 +5,10 @@ on: branches-ignore: - master - 'dependabot**' - - 'test**' jobs: lint: name: Lint - if: ${{ !startsWith(github.ref, 'refs/heads/dependabot') }} runs-on: ubuntu-24.04-arm steps: - name: Checkout @@ -21,8 +19,9 @@ jobs: with: dockerfile: Dockerfile - build_test: + build-test: name: Push test + if: ${{ !startsWith(github.ref, 'refs/heads/doc') && !startsWith(github.ref, 'refs/heads/test') }} runs-on: ubuntu-24.04-arm steps: - name: Checkout @@ -62,7 +61,7 @@ jobs: TERM: xterm-256color run: make push - pull_request: + pull-request: name: Pull Request runs-on: ubuntu-24.04-arm steps: @@ -83,4 +82,4 @@ jobs: github_token: ${{ secrets.GITHUB_TOKEN }} assignee: ${{ github.actor }} template: .tmp/PULL_REQUEST_TEMPLATE.md - get_diff: true \ No newline at end of file + get_diff: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index dac97bd..0239206 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,7 +11,7 @@ on: jobs: release: name: Create Release - runs-on: ubuntu-latest + runs-on: ubuntu-24.04-arm steps: - name: Checkout uses: actions/checkout@v4 @@ -41,7 +41,7 @@ jobs: VERSION="${{ github.event.inputs.version }}" git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" - git tag -a "$VERSION" -m "Release $VERSION" + git tag -a "$VERSION" -m "$VERSION" git push origin "$VERSION" - name: Docker Buildx diff --git a/.github/workflows/weekly-dependency-check.yml b/.github/workflows/weekly-dependency-check.yml index e7f344e..8921136 100644 --- a/.github/workflows/weekly-dependency-check.yml +++ b/.github/workflows/weekly-dependency-check.yml @@ -2,20 +2,16 @@ name: Weekly Dependency Check on: schedule: - # Run every Sunday at 02:00 UTC - - cron: '0 2 * * 0' - workflow_dispatch: # Allow manual trigger + # Run every Monday at 08:00 UTC + - cron: '0 8 * * 1' jobs: dependency-check: name: Test Dependencies - runs-on: ubuntu-latest + runs-on: ubuntu-24.04-arm steps: - name: Checkout uses: actions/checkout@v4 - with: - ref: 'master' - fetch-depth: 0 - name: Get latest release tag id: latest-tag @@ -29,10 +25,6 @@ jobs: echo "tag=$LATEST_TAG" >> $GITHUB_OUTPUT echo "Testing dependencies for tag: $LATEST_TAG" - - name: Checkout latest release - run: | - git checkout ${{ steps.latest-tag.outputs.tag }} - - name: Docker Buildx uses: docker/setup-buildx-action@v3 with: @@ -44,25 +36,12 @@ jobs: image: tonistiigi/binfmt:latest platforms: amd64,arm64 - - name: Test build and push + - name: Build & push test image env: DOCKER_BUILDKIT: 1 DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - VERSION: test-${{ steps.latest-tag.outputs.tag }} + VERSION: ${{ steps.latest-tag.outputs.tag }} VERSION_PREFIX: test- TERM: xterm-256color run: make push - - - name: Notify on failure - if: failure() - uses: actions/github-script@v7.0.1 - with: - script: | - github.rest.issues.create({ - owner: context.repo.owner, - repo: context.repo.repo, - title: `Weekly dependency check failed for ${context.payload.inputs?.tag || '${{ steps.latest-tag.outputs.tag }}'}`, - body: `The weekly dependency check failed when building from tag ${{ steps.latest-tag.outputs.tag }}.\n\nPlease check the [workflow run](https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}) for details.`, - labels: ['bug', 'dependencies'] - })