diff --git a/.github/renovate.json b/.github/renovate.json index 75844af..d45a3f3 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -5,16 +5,30 @@ ":semanticCommitType(deps)", ":automergeMinor" ], - "regexManagers": [{ - "fileMatch": [ - "Dockerfile" - ], - "matchStrings": [ - "# renovate: datasource=(?\\S+) depName=(?\\S+)( versioning=(?.*?))?\nENV .*?_VERSION=(?.*)" - ], - "versioningTemplate": "{{#if versioning}}{{{versioning}}}{{else}}semver{{/if}}" - }], - "packageRules": [{ + "regexManagers": [ + { + "fileMatch": [ + "Dockerfile" + ], + "matchStrings": [ + "# renovate: datasource=(?\\S+) depName=(?\\S+)( versioning=(?.*?))?\nENV .*?_VERSION=(?.*)" + ], + "versioningTemplate": "{{#if versioning}}{{{versioning}}}{{else}}semver{{/if}}" + } + ], + "packageRules": [ + { + "description": "Strip prefix from kustomize", + "groupName": "version prefix", + "matchDatasources": [ + "github-releases" + ], + "packageNames": [ + "kubernetes-sigs/kustomize" + ], + "extractVersion": "^kustomize\\/v(?\\d+\\.\\d+\\.\\d+)$" + }, + { "description": "Strip v prefix from versions", "groupName": "version prefix", "matchDatasources": [ @@ -32,8 +46,8 @@ "minor", "patch" ], - "semanticCommitType": "deps", - "semanticCommitScope": "minor", + "semanticCommitType": "minor", + "semanticCommitScope": "deps", "automerge": true }, { @@ -45,8 +59,8 @@ "matchUpdateTypes": [ "major" ], - "semanticCommitType": "deps", - "semanticCommitScope": "major", + "semanticCommitType": "major", + "semanticCommitScope": "deps", "automerge": true }, { @@ -58,8 +72,8 @@ "matchUpdateTypes": [ "minor" ], - "semanticCommitType": "deps", - "semanticCommitScope": "minor", + "semanticCommitType": "minor", + "semanticCommitScope": "deps", "automerge": true }, { @@ -71,12 +85,12 @@ "matchUpdateTypes": [ "patch" ], - "semanticCommitType": "deps", - "semanticCommitScope": "patch", + "semanticCommitType": "patch", + "semanticCommitScope": "deps", "automerge": true } ], "labels": [ "renovate" ] -} \ No newline at end of file +} diff --git a/.github/semantic.yml b/.github/semantic.yml new file mode 100644 index 0000000..0724847 --- /dev/null +++ b/.github/semantic.yml @@ -0,0 +1,23 @@ +--- +commitsOnly: true +anyCommit: true +allowMergeCommits: true +allowRevertCommits: true + +types: + - feat + - fix + - docs + - style + - refactor + - perf + - test + - build + - ci + - chore + - revert + - major + - minor + - patch + +... diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index daee24e..f2b4ad8 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -1,17 +1,19 @@ --- name: docker -'on': - push: - branches: - - v1 +"on": pull_request: branches: - - v1 + - master + push: + branches: + - master + tags: + - v* jobs: publish: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - name: Checkout source @@ -27,10 +29,10 @@ jobs: flavor: | latest=true tags: | - type=ref,enable=true,event=branch type=ref,enable=true,event=tag - type=semver,pattern={{version}} - type=semver,pattern={{major}}.{{minor}} + type=semver,pattern=v{{version}} + type=semver,pattern=v{{major}}.{{minor}} + type=semver,pattern=v{{major}} labels: | org.opencontainers.image.vendor=Webhippie maintainer=Thomas Boerger @@ -62,4 +64,9 @@ jobs: labels: ${{ steps.meta.outputs.labels }} tags: ${{ steps.meta.outputs.tags }} + - name: Update version + id: version + uses: nowactions/update-majorver@v1 + if: startsWith(github.ref, 'refs/tags/v') + ... diff --git a/.github/workflows/lock.yml b/.github/workflows/lock.yml new file mode 100644 index 0000000..b2ed63d --- /dev/null +++ b/.github/workflows/lock.yml @@ -0,0 +1,23 @@ +--- +name: lock + +"on": + schedule: + - cron: "0 0 * * *" + workflow_dispatch: + +permissions: + issues: write + pull-requests: write + +concurrency: + group: lock + +jobs: + execute: + runs-on: ubuntu-latest + + steps: + - uses: dessant/lock-threads@v4 + +... diff --git a/.github/workflows/react.yml b/.github/workflows/react.yml new file mode 100644 index 0000000..0dd7173 --- /dev/null +++ b/.github/workflows/react.yml @@ -0,0 +1,31 @@ +--- +name: react + +"on": + issue_comment: + types: + - created + - edited + pull_request_review_comment: + types: + - created + - edited + schedule: + - cron: "0 0 * * *" + +permissions: + actions: write + issues: write + pull-requests: write + +concurrency: + group: react + +jobs: + execute: + runs-on: ubuntu-latest + + steps: + - uses: dessant/reaction-comments@v3 + +... diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..5c351ab --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,28 @@ +--- +name: release + +"on": + schedule: + - cron: "0 8 * * 1" + workflow_dispatch: + +jobs: + release: + runs-on: ubuntu-latest + + steps: + - name: Checkout source + uses: actions/checkout@v3 + with: + token: ${{ secrets.BOT_ACCESS_TOKEN }} + + - name: Semantic release + uses: cycjimmy/semantic-release-action@v3 + env: + GITHUB_TOKEN: ${{ secrets.BOT_ACCESS_TOKEN }} + with: + extra_plugins: | + @semantic-release/exec + conventional-changelog-conventionalcommits + +... diff --git a/.releaserc b/.releaserc new file mode 100644 index 0000000..cb37c2d --- /dev/null +++ b/.releaserc @@ -0,0 +1,117 @@ +{ + "branches": [ + "master" + ], + "plugins": [ + [ + "@semantic-release/commit-analyzer", + { + "preset": "conventionalcommits", + "releaseRules": [ + { + "type": "major", + "release": "major" + }, + { + "type": "deps", + "scope": "major", + "release": "major" + }, + { + "type": "minor", + "release": "minor" + }, + { + "type": "deps", + "scope": "minor", + "release": "minor" + }, + { + "type": "patch", + "release": "patch" + }, + { + "type": "deps", + "scope": "patch", + "release": "patch" + }, + { + "type": "refactor", + "release": "minor" + }, + { + "scope": "docs", + "release": false + } + ] + } + ], + [ + "@semantic-release/release-notes-generator", + { + "preset": "conventionalcommits", + "presetConfig": { + "types": [ + { + "type": "feat", + "section": "Features" + }, + { + "type": "major", + "section": "Features" + }, + { + "type": "minor", + "section": "Features" + }, + { + "type": "fix", + "section": "Bugfixes" + }, + { + "type": "patch", + "section": "Bugfixes" + }, + { + "type": "chore", + "hidden": true + }, + { + "type": "docs", + "hidden": true + }, + { + "type": "refactor", + "hidden": true + } + ] + } + } + ], + [ + "@semantic-release/changelog", + { + "changelogTitle": "# Changelog" + } + ], + [ + "@semantic-release/exec", + { + "prepareCmd": "./hack/action-version.sh ${nextRelease.version}" + } + ], + [ + "@semantic-release/git", + { + "message": "chore: release ${nextRelease.version}", + "assets": ["CHANGELOG.md", "action.yml"] + } + ], + [ + "@semantic-release/github", + { + "addReleases": true + } + ] + ] +} diff --git a/README.md b/README.md index 2bba3ec..4d0d94c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # yamllint -[![Current Tag](https://img.shields.io/github/v/tag/actionhippie/yamllint?sort=semver)](https://github.com/actionhippie/yamllint) [![Docker Build](https://github.com/actionhippie/yamllint/workflows/docker/badge.svg)](https://github.com/actionhippie/yamllint/actions?query=workflow%3Adocker) +[![Current Tag](https://img.shields.io/github/v/tag/actionhippie/yamllint?sort=semver)](https://github.com/actionhippie/yamllint) [![Docker Build](https://github.com/actionhippie/yamllint/workflows/docker/badge.svg)](https://github.com/actionhippie/yamllint/actions/workflows/docker.yml) [GitHub Action](https://github.com/features/actions) to validate/lint YAML files. diff --git a/action.yml b/action.yml index de72f70..fb3fde3 100644 --- a/action.yml +++ b/action.yml @@ -45,6 +45,6 @@ outputs: runs: using: 'docker' - image: 'docker://ghcr.io/actionhippie/yamllint:v1' + image: 'docker://ghcr.io/actionhippie/yamllint:latest' ... diff --git a/hack/action-version.sh b/hack/action-version.sh new file mode 100755 index 0000000..6ad3d01 --- /dev/null +++ b/hack/action-version.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +set -eo pipefail + +if [ $# -ne 1 ]; then + echo "Usage: ${0} VERSION" + exit 1 +fi + +VERSION=${1} +shift + +ROOT=$(cd $(dirname $0)/..; pwd) + +sed \ + -i \ + "s|'docker://ghcr.io/actionhippie/yamllint:.*'|'docker://ghcr.io/actionhippie/yamllint:v${VERSION}'|" \ + ${ROOT}/action.yml