From 79a1f36d7aabc8a620ebc09f785ca00ce433768f Mon Sep 17 00:00:00 2001 From: The Oh Brothers Bot Date: Sun, 25 Feb 2024 13:11:58 +0000 Subject: [PATCH] Refactor: Update CI files Signed-off-by: The Oh Brothers Bot --- .github/release-drafter.yml | 4 + .github/workflows/ci-master-pr.yml | 100 +++++++++--------- generate/definitions/FILES.ps1 | 1 - .../templates/.github/release-drafter.yml.ps1 | 52 --------- .../.github/workflows/ci-master-pr.yml.ps1 | 14 +-- 5 files changed, 62 insertions(+), 109 deletions(-) delete mode 100644 generate/templates/.github/release-drafter.yml.ps1 diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml index 80c8b7b..1c833d6 100644 --- a/.github/release-drafter.yml +++ b/.github/release-drafter.yml @@ -4,7 +4,11 @@ categories: - title: '🚀 Features' labels: - 'feature' + - title: '✨ Enhancements' + labels: - 'enhancement' + - title: '🎚 Change' + labels: - 'change' - title: '🐛 Bug Fixes' labels: diff --git a/.github/workflows/ci-master-pr.yml b/.github/workflows/ci-master-pr.yml index 0e64d67..c012c36 100644 --- a/.github/workflows/ci-master-pr.yml +++ b/.github/workflows/ci-master-pr.yml @@ -37,7 +37,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Display system info (linux) run: | @@ -61,7 +61,7 @@ jobs: uses: docker/setup-buildx-action@v2 - name: Cache Docker layers - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: /tmp/.buildx-cache key: ${{ runner.os }}-buildx-2.6.8-${{ github.sha }} @@ -105,7 +105,7 @@ jobs: - name: 2.6.8-alpine-3.18 - Build (PRs) # Run only on pull requests if: github.event_name == 'pull_request' - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: context: variants/2.6.8-alpine-3.18 platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x @@ -119,7 +119,7 @@ jobs: - name: 2.6.8-alpine-3.18 - Build and push (master) # Run only on master if: github.ref == 'refs/heads/master' - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: context: variants/2.6.8-alpine-3.18 platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x @@ -132,7 +132,7 @@ jobs: - name: 2.6.8-alpine-3.18 - Build and push (release) if: startsWith(github.ref, 'refs/tags/') - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: context: variants/2.6.8-alpine-3.18 platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x @@ -157,7 +157,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Display system info (linux) run: | @@ -181,7 +181,7 @@ jobs: uses: docker/setup-buildx-action@v2 - name: Cache Docker layers - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: /tmp/.buildx-cache key: ${{ runner.os }}-buildx-2.5.8-${{ github.sha }} @@ -225,7 +225,7 @@ jobs: - name: 2.5.8-alpine-3.17 - Build (PRs) # Run only on pull requests if: github.event_name == 'pull_request' - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: context: variants/2.5.8-alpine-3.17 platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x @@ -239,7 +239,7 @@ jobs: - name: 2.5.8-alpine-3.17 - Build and push (master) # Run only on master if: github.ref == 'refs/heads/master' - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: context: variants/2.5.8-alpine-3.17 platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x @@ -252,7 +252,7 @@ jobs: - name: 2.5.8-alpine-3.17 - Build and push (release) if: startsWith(github.ref, 'refs/tags/') - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: context: variants/2.5.8-alpine-3.17 platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x @@ -276,7 +276,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Display system info (linux) run: | @@ -300,7 +300,7 @@ jobs: uses: docker/setup-buildx-action@v2 - name: Cache Docker layers - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: /tmp/.buildx-cache key: ${{ runner.os }}-buildx-2.4.12-${{ github.sha }} @@ -344,7 +344,7 @@ jobs: - name: 2.4.12-alpine-3.12 - Build (PRs) # Run only on pull requests if: github.event_name == 'pull_request' - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: context: variants/2.4.12-alpine-3.12 platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x @@ -358,7 +358,7 @@ jobs: - name: 2.4.12-alpine-3.12 - Build and push (master) # Run only on master if: github.ref == 'refs/heads/master' - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: context: variants/2.4.12-alpine-3.12 platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x @@ -371,7 +371,7 @@ jobs: - name: 2.4.12-alpine-3.12 - Build and push (release) if: startsWith(github.ref, 'refs/tags/') - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: context: variants/2.4.12-alpine-3.12 platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x @@ -395,7 +395,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Display system info (linux) run: | @@ -419,7 +419,7 @@ jobs: uses: docker/setup-buildx-action@v2 - name: Cache Docker layers - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: /tmp/.buildx-cache key: ${{ runner.os }}-buildx-2.4.11-${{ github.sha }} @@ -463,7 +463,7 @@ jobs: - name: 2.4.11-alpine-3.11 - Build (PRs) # Run only on pull requests if: github.event_name == 'pull_request' - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: context: variants/2.4.11-alpine-3.11 platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x @@ -477,7 +477,7 @@ jobs: - name: 2.4.11-alpine-3.11 - Build and push (master) # Run only on master if: github.ref == 'refs/heads/master' - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: context: variants/2.4.11-alpine-3.11 platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x @@ -490,7 +490,7 @@ jobs: - name: 2.4.11-alpine-3.11 - Build and push (release) if: startsWith(github.ref, 'refs/tags/') - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: context: variants/2.4.11-alpine-3.11 platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x @@ -530,7 +530,7 @@ jobs: - name: 2.4.11-alpine-3.10 - Build (PRs) # Run only on pull requests if: github.event_name == 'pull_request' - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: context: variants/2.4.11-alpine-3.10 platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x @@ -544,7 +544,7 @@ jobs: - name: 2.4.11-alpine-3.10 - Build and push (master) # Run only on master if: github.ref == 'refs/heads/master' - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: context: variants/2.4.11-alpine-3.10 platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x @@ -557,7 +557,7 @@ jobs: - name: 2.4.11-alpine-3.10 - Build and push (release) if: startsWith(github.ref, 'refs/tags/') - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: context: variants/2.4.11-alpine-3.10 platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x @@ -581,7 +581,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Display system info (linux) run: | @@ -605,7 +605,7 @@ jobs: uses: docker/setup-buildx-action@v2 - name: Cache Docker layers - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: /tmp/.buildx-cache key: ${{ runner.os }}-buildx-2.4.6-${{ github.sha }} @@ -649,7 +649,7 @@ jobs: - name: 2.4.6-alpine-3.9 - Build (PRs) # Run only on pull requests if: github.event_name == 'pull_request' - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: context: variants/2.4.6-alpine-3.9 platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x @@ -663,7 +663,7 @@ jobs: - name: 2.4.6-alpine-3.9 - Build and push (master) # Run only on master if: github.ref == 'refs/heads/master' - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: context: variants/2.4.6-alpine-3.9 platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x @@ -676,7 +676,7 @@ jobs: - name: 2.4.6-alpine-3.9 - Build and push (release) if: startsWith(github.ref, 'refs/tags/') - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: context: variants/2.4.6-alpine-3.9 platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x @@ -716,7 +716,7 @@ jobs: - name: 2.4.6-alpine-3.8 - Build (PRs) # Run only on pull requests if: github.event_name == 'pull_request' - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: context: variants/2.4.6-alpine-3.8 platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x @@ -730,7 +730,7 @@ jobs: - name: 2.4.6-alpine-3.8 - Build and push (master) # Run only on master if: github.ref == 'refs/heads/master' - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: context: variants/2.4.6-alpine-3.8 platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x @@ -743,7 +743,7 @@ jobs: - name: 2.4.6-alpine-3.8 - Build and push (release) if: startsWith(github.ref, 'refs/tags/') - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: context: variants/2.4.6-alpine-3.8 platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x @@ -767,7 +767,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Display system info (linux) run: | @@ -791,7 +791,7 @@ jobs: uses: docker/setup-buildx-action@v2 - name: Cache Docker layers - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: /tmp/.buildx-cache key: ${{ runner.os }}-buildx-2.4.4-${{ github.sha }} @@ -835,7 +835,7 @@ jobs: - name: 2.4.4-alpine-3.7 - Build (PRs) # Run only on pull requests if: github.event_name == 'pull_request' - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: context: variants/2.4.4-alpine-3.7 platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x @@ -849,7 +849,7 @@ jobs: - name: 2.4.4-alpine-3.7 - Build and push (master) # Run only on master if: github.ref == 'refs/heads/master' - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: context: variants/2.4.4-alpine-3.7 platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x @@ -862,7 +862,7 @@ jobs: - name: 2.4.4-alpine-3.7 - Build and push (release) if: startsWith(github.ref, 'refs/tags/') - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: context: variants/2.4.4-alpine-3.7 platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x @@ -902,7 +902,7 @@ jobs: - name: 2.4.4-alpine-3.6 - Build (PRs) # Run only on pull requests if: github.event_name == 'pull_request' - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: context: variants/2.4.4-alpine-3.6 platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x @@ -916,7 +916,7 @@ jobs: - name: 2.4.4-alpine-3.6 - Build and push (master) # Run only on master if: github.ref == 'refs/heads/master' - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: context: variants/2.4.4-alpine-3.6 platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x @@ -929,7 +929,7 @@ jobs: - name: 2.4.4-alpine-3.6 - Build and push (release) if: startsWith(github.ref, 'refs/tags/') - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: context: variants/2.4.4-alpine-3.6 platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x @@ -953,7 +953,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Display system info (linux) run: | @@ -977,7 +977,7 @@ jobs: uses: docker/setup-buildx-action@v2 - name: Cache Docker layers - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: /tmp/.buildx-cache key: ${{ runner.os }}-buildx-2.3.18-${{ github.sha }} @@ -1021,7 +1021,7 @@ jobs: - name: 2.3.18-alpine-3.5 - Build (PRs) # Run only on pull requests if: github.event_name == 'pull_request' - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: context: variants/2.3.18-alpine-3.5 platforms: linux/amd64 @@ -1035,7 +1035,7 @@ jobs: - name: 2.3.18-alpine-3.5 - Build and push (master) # Run only on master if: github.ref == 'refs/heads/master' - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: context: variants/2.3.18-alpine-3.5 platforms: linux/amd64 @@ -1048,7 +1048,7 @@ jobs: - name: 2.3.18-alpine-3.5 - Build and push (release) if: startsWith(github.ref, 'refs/tags/') - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: context: variants/2.3.18-alpine-3.5 platforms: linux/amd64 @@ -1088,7 +1088,7 @@ jobs: - name: 2.3.18-alpine-3.4 - Build (PRs) # Run only on pull requests if: github.event_name == 'pull_request' - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: context: variants/2.3.18-alpine-3.4 platforms: linux/amd64 @@ -1102,7 +1102,7 @@ jobs: - name: 2.3.18-alpine-3.4 - Build and push (master) # Run only on master if: github.ref == 'refs/heads/master' - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: context: variants/2.3.18-alpine-3.4 platforms: linux/amd64 @@ -1115,7 +1115,7 @@ jobs: - name: 2.3.18-alpine-3.4 - Build and push (release) if: startsWith(github.ref, 'refs/tags/') - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: context: variants/2.3.18-alpine-3.4 platforms: linux/amd64 @@ -1155,7 +1155,7 @@ jobs: - name: 2.3.18-alpine-3.3 - Build (PRs) # Run only on pull requests if: github.event_name == 'pull_request' - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: context: variants/2.3.18-alpine-3.3 platforms: linux/amd64 @@ -1169,7 +1169,7 @@ jobs: - name: 2.3.18-alpine-3.3 - Build and push (master) # Run only on master if: github.ref == 'refs/heads/master' - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: context: variants/2.3.18-alpine-3.3 platforms: linux/amd64 @@ -1182,7 +1182,7 @@ jobs: - name: 2.3.18-alpine-3.3 - Build and push (release) if: startsWith(github.ref, 'refs/tags/') - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: context: variants/2.3.18-alpine-3.3 platforms: linux/amd64 diff --git a/generate/definitions/FILES.ps1 b/generate/definitions/FILES.ps1 index f64d3bc..42c0f57 100644 --- a/generate/definitions/FILES.ps1 +++ b/generate/definitions/FILES.ps1 @@ -1,6 +1,5 @@ # Files' definition $FILES = @( '.github/workflows/ci-master-pr.yml' - '.github/release-drafter.yml' 'README.md' ) diff --git a/generate/templates/.github/release-drafter.yml.ps1 b/generate/templates/.github/release-drafter.yml.ps1 deleted file mode 100644 index 9cb863e..0000000 --- a/generate/templates/.github/release-drafter.yml.ps1 +++ /dev/null @@ -1,52 +0,0 @@ -@' -name-template: 'v$RESOLVED_VERSION 🌈' -tag-template: 'v$RESOLVED_VERSION' -categories: - - title: '🚀 Features' - labels: - - 'feature' - - 'enhancement' - - 'change' - - title: '🐛 Bug Fixes' - labels: - - 'fix' - - 'bug' - - title: '🖊️ Refactors' - labels: - - 'refactor' - - title: '👗 Style' - labels: - - 'style' - - title: '📝 Documentation' - labels: - - 'docs' - - 'documentation' - - title: '🧰 Maintenance' - label: 'chore' -change-template: '- $TITLE @$AUTHOR (#$NUMBER)' -version-resolver: - major: - labels: - - 'breaking' - minor: - labels: - - 'feature' - - 'enhancement' - - 'change' - - 'refactor' - patch: - labels: - - 'fix' - - 'bug' - - 'style' - - 'docs' - - 'documentation' - - 'chore' - default: patch -sort-by: title -template: | - ## Changes - - $CHANGES - -'@ diff --git a/generate/templates/.github/workflows/ci-master-pr.yml.ps1 b/generate/templates/.github/workflows/ci-master-pr.yml.ps1 index 9be7359..d65c283 100644 --- a/generate/templates/.github/workflows/ci-master-pr.yml.ps1 +++ b/generate/templates/.github/workflows/ci-master-pr.yml.ps1 @@ -36,7 +36,9 @@ jobs: '@ # Group variants by the package version -$groups = $VARIANTS | Group-Object -Property { $_['_metadata']['job_group_key'] } | Sort-Object { [version]$_.Name.Split('-')[0] } -Descending +$groups = @( + $VARIANTS | Group-Object -Property { $_['_metadata']['job_group_key'] } | Sort-Object { [version]$_.Name.Split('-')[0] } -Descending +) $WORKFLOW_JOB_NAMES = $groups | % { "build-$( $_.Name.Replace('.', '-') )" } foreach ($g in $groups) { @" @@ -46,7 +48,7 @@ foreach ($g in $groups) { runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Display system info (linux) run: | @@ -70,7 +72,7 @@ foreach ($g in $groups) { uses: docker/setup-buildx-action@v2 - name: Cache Docker layers - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: /tmp/.buildx-cache key: `${{ runner.os }}-buildx-$( $g.Name )-`${{ github.sha }} @@ -119,7 +121,7 @@ foreach ($v in $g.Group) { - name: $( $v['tag' ] ) - Build (PRs) # Run only on pull requests if: github.event_name == 'pull_request' - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: context: $( $v['build_dir_rel'] ) platforms: $( $v['_metadata']['platforms'] -join ',' ) @@ -133,7 +135,7 @@ foreach ($v in $g.Group) { - name: $( $v['tag' ] ) - Build and push (master) # Run only on master if: github.ref == 'refs/heads/master' - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: context: $( $v['build_dir_rel'] ) platforms: $( $v['_metadata']['platforms'] -join ',' ) @@ -146,7 +148,7 @@ foreach ($v in $g.Group) { - name: $( $v['tag' ] ) - Build and push (release) if: startsWith(github.ref, 'refs/tags/') - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: context: $( $v['build_dir_rel'] ) platforms: $( $v['_metadata']['platforms'] -join ',' )