From 9854cb7487e08ed058b38e9496d3dae888ade92c Mon Sep 17 00:00:00 2001 From: Eric Weber Date: Sun, 1 Dec 2024 19:49:27 +0000 Subject: [PATCH] feat: define file bumper image --- file-bumper/.release-it.json | 68 ++++++++++++++++++++++++++++++++++++ file-bumper/Dockerfile | 4 +++ file-bumper/docker-bake.hcl | 12 +++++++ 3 files changed, 84 insertions(+) create mode 100644 file-bumper/.release-it.json create mode 100644 file-bumper/Dockerfile create mode 100644 file-bumper/docker-bake.hcl diff --git a/file-bumper/.release-it.json b/file-bumper/.release-it.json new file mode 100644 index 0000000..47ea539 --- /dev/null +++ b/file-bumper/.release-it.json @@ -0,0 +1,68 @@ +{ + "git": { + "getLatestTagFromAllRefs": true, + "commit": true, + "tag": true, + "pushArgs": ["--tags"], + "tagName": "${version}" + }, + "github": { + "release": true + }, + "plugins": { + "@release-it/bumper": { + "out": { + "file": "VERSION", + "type": "text/plain", + "consumeWholeFile": true + } + }, + "@release-it/conventional-changelog": { + "preset": { + "name": "conventionalcommits", + "types": [ + { + "type": "feat", + "section": ":rocket: Features" + }, + { + "type": "fix", + "section": ":bug: Bug fixes" + }, + { + "type": "build", + "section": ":package: Build" + }, + { + "type": "ci", + "section": ":robot: CI/CD" + }, + { + "type": "docs", + "section": ":page_facing_up: Docs" + }, + { + "type": "perf", + "section": ":checkered_flag: Performance" + }, + { + "type": "refactor", + "section": ":twisted_rightwards_arrows: Refactor" + }, + { + "type": "style", + "section": ":broom: Style" + }, + { + "type": "test", + "section": ":test_tube: Tests" + }, + { + "type": "chore", + "hidden": true + } + ] + } + } + } +} diff --git a/file-bumper/Dockerfile b/file-bumper/Dockerfile new file mode 100644 index 0000000..33770c0 --- /dev/null +++ b/file-bumper/Dockerfile @@ -0,0 +1,4 @@ +FROM base + +RUN npm install -g @release-it/bumper +COPY .release-it.json /.release-it.json diff --git a/file-bumper/docker-bake.hcl b/file-bumper/docker-bake.hcl new file mode 100644 index 0000000..d4aab2d --- /dev/null +++ b/file-bumper/docker-bake.hcl @@ -0,0 +1,12 @@ +// Expected to be used with https://github.com/rcwbr/dockerfile-partials/blob/main/github-cache-bake.hcl +// For example, docker buildx bake -f github-cache-bake.hcl -f cwd://docker-bake.hcl https://github.com/rcwbr/dockerfile-partials.git#0.1.0 + +target "default" { + contexts = { + base = ( + ("${GITHUB_REF_PROTECTED}" == "true" || "${GITHUB_REF_TYPE}" == "tag" ) + ? "docker-image://${REGISTRY}release-it-docker-conventional-changelog:${VERSION}" + : "docker-image://${REGISTRY}release-it-docker-conventional-changelog:${VERSION}-${GITHUB_SHA}" + ) + } +}