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 277a066..567980a 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-1.25.3-${{ github.sha }} @@ -105,7 +105,7 @@ jobs: - name: 1.25.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/1.25.3 platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/ppc64le,linux/s390x @@ -119,7 +119,7 @@ jobs: - name: 1.25.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/1.25.3 platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/ppc64le,linux/s390x @@ -132,7 +132,7 @@ jobs: - name: 1.25.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/1.25.3 platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/ppc64le,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-1.24.0-${{ github.sha }} @@ -225,7 +225,7 @@ jobs: - name: 1.24.0 - 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/1.24.0 platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/ppc64le,linux/s390x @@ -239,7 +239,7 @@ jobs: - name: 1.24.0 - 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/1.24.0 platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/ppc64le,linux/s390x @@ -252,7 +252,7 @@ jobs: - name: 1.24.0 - 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/1.24.0 platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/ppc64le,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-1.23.4-${{ github.sha }} @@ -344,7 +344,7 @@ jobs: - name: 1.23.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/1.23.4 platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/ppc64le,linux/s390x @@ -358,7 +358,7 @@ jobs: - name: 1.23.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/1.23.4 platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/ppc64le,linux/s390x @@ -371,7 +371,7 @@ jobs: - name: 1.23.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/1.23.4 platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/ppc64le,linux/s390x diff --git a/LICENSE b/LICENSE index 605f39e..7ae7c0d 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,3 @@ - Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ @@ -179,7 +178,7 @@ APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" + boilerplate notice, with the fields enclosed by brackets "{}" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a @@ -187,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2022 Takahiro INOUE + Copyright 2019 The Oh Brothers Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Update-Versions.ps1 b/Update-Versions.ps1 deleted file mode 100644 index 69470db..0000000 --- a/Update-Versions.ps1 +++ /dev/null @@ -1,55 +0,0 @@ -# This script is to update versions in versions.json, create PR(s) for each bumped version, merge PRs, and release -# It may be run manually or as a cron -# Use -WhatIf for dry run -[CmdletBinding(SupportsShouldProcess)] -param ( - [Parameter(HelpMessage="Whether to clone a temporary repo before opening PRs. Useful in development")] - [switch]$CloneTempRepo -, - [Parameter(HelpMessage="Whether to open a PR for each updated version in versions.json")] - [switch]$PR -, - [Parameter(HelpMessage="Whether to merge each PR one after another (note that this is not GitHub merge queue which cannot handle merge conflicts). The queue ensures each PR is rebased to prevent merge conflicts")] - [switch]$AutoMergeQueue -, - [Parameter(HelpMessage="Whether to create a tagged release and closing milestone, after merging all PRs")] - [switch]$AutoRelease -, - [Parameter(HelpMessage="-AutoRelease tag convention")] - [ValidateSet('calver', 'semver')] - [string]$AutoReleaseTagConvention = 'calver' -) -$ErrorActionPreference = 'Stop' -Set-StrictMode -Version Latest - -# Install modules -@( - 'Generate-DockerImageVariantsHelpers' - 'Powershell-Yaml' -) | % { - if (! (Get-InstalledModule $_ -ErrorAction SilentlyContinue) ) { - Install-Module $_ -Scope CurrentUser -Force - } -} -# Override with development module if it exists -if (Test-Path ../Generate-DockerImageVariantsHelpers/src/Generate-DockerImageVariantsHelpers) { - Import-module ../Generate-DockerImageVariantsHelpers/src/Generate-DockerImageVariantsHelpers -Force -} - -try { - if ($CloneTempRepo) { - $repo = Clone-TempRepo - Push-Location $repo - } - - # Update versions.json, and open PRs with CI disabled - $prs = Update-DockerImageVariantsVersions -CommitPreScriptblock { Move-Item .github .github.disabled -Force } -PR:$PR -WhatIf:$WhatIfPreference - # Update versions.json, update PRs with CI, merge PRs one at a time, release and close milestone - $return = Update-DockerImageVariantsVersions -PR:$PR -AutoMergeQueue:$AutoMergeQueue -AutoRelease:$AutoRelease -AutoReleaseTagConvention $AutoReleaseTagConvention -WhatIf:$WhatIfPreference -}catch { - throw -}finally { - if ($CloneTempRepo) { - Pop-Location - } -} diff --git a/generate/definitions/FILES.ps1 b/generate/definitions/FILES.ps1 index f64d3bc..42c0f57 100755 --- 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 ',' )