Skip to content

Commit 310c5af

Browse files
committed
chore: release 0.1.1
1 parent a69cf56 commit 310c5af

3 files changed

Lines changed: 36 additions & 6 deletions

File tree

Taskfile.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,8 @@ tasks:
1212
cmds:
1313
- |
1414
copier update --vcs-ref HEAD .
15+
# Release
16+
release:
17+
cmds:
18+
- |
19+
{{.TASKFILE_DIR}}/release

copier-template/.pre-commit-config.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ repos:
1414
- id: detect-private-key # detect private key
1515
# Prevent committing inline conflict markers
1616
- id: check-merge-conflict
17-
args: [ --assume-in-merge ]
17+
args: [--assume-in-merge]
1818
# Checks that scripts with shebangs are executable
1919
- id: check-shebang-scripts-are-executable
2020
# Checks for symlinks which do not point to anything.
@@ -24,19 +24,19 @@ repos:
2424
hooks:
2525
- id: markdown-link-check
2626
name: markdown link check
27-
args: [ --quiet, "--config", ".config/markdown-link-check.config.json" ]
27+
args: [--quiet, "--config", ".config/markdown-link-check.config.json"]
2828
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
2929
rev: e46582c # v9.23.0
3030
hooks:
3131
# equivalent to:
3232
# commitlint --extends '@commitlint/config-conventional' --verbose --edit "$1"
3333
- id: commitlint
3434
name: check commit message
35-
stages: [ commit-msg ]
36-
additional_dependencies: [ '@commitlint/config-conventional' ]
37-
args: [ "--verbose" , "--config", ".config/commitlint.config.js" ]
35+
stages: [commit-msg]
36+
additional_dependencies: ['@commitlint/config-conventional']
37+
args: ["--verbose", "--config", ".config/commitlint.config.js"]
3838
- repo: https://github.com/combostrap/devfiles
39-
rev: v0.1.0
39+
rev: v0.1.1
4040
hooks:
4141
- id: prevent-out-of-sync-commit
4242
name: prevent out-of-sync branch commit

release

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/env bash
2+
set -TCEeuo pipefail # Strict Bash
3+
4+
# The release script of this repo
5+
# It's mandatory because the tag version is in the .pre-commit-config.yaml tag file
6+
# so we need to update it
7+
8+
bump_type=${1:-"patch"} # or minor, major
9+
# Get the tags locally
10+
git pull
11+
# calculate the next version
12+
export GIT_CLIFF__BUMP__INITIAL_TAG=v0.1.0 # by default it's 0.1.0
13+
next_version=$(git cliff --unreleased --bump "$bump_type" --context --tag-pattern "v[0-9]+\\.[0-9]+\\.[0-9]+" | jq -r '.[0].version' | tr -d "v")
14+
15+
# Update in-place the version
16+
yq -i "(.repos[] | select(.repo | match(\".*$ORGANISATION_PATH_NAME/devfiles$\")) | .rev) = \"v$next_version\"" copier-template/.pre-commit-config.yaml
17+
git-commit "chore: release $next_version"
18+
19+
echo "Releasing to the version $next_version"
20+
# release
21+
JRELEASER_PROJECT_VERSION="$next_version" jreleaser release
22+
# Tag is created locally and remotely (force pull)
23+
# git refuse otherwise with `tag would clobber existing tag`
24+
git pull --force
25+
echo "Release done"

0 commit comments

Comments
 (0)