| 1 |
# TODO: |
| 2 |
# - Check for a bat upgrade as it might bring new language support/themes |
| 3 |
# - Update README prior to release |
| 4 |
# - Update help text in README, with BAT_THEME unset |
| 5 |
|
| 6 |
release: \ |
| 7 |
clean \ |
| 8 |
check-environment \ |
| 9 |
bump-version \ |
| 10 |
create-github-release \ |
| 11 |
bump-version-in-documentation-links |
| 12 |
|
| 13 |
|
| 14 |
clean: |
| 15 |
rm -fr .make-sentinels |
| 16 |
|
| 17 |
|
| 18 |
check-environment: |
| 19 |
[ -n "$$DELTA_OLD_VERSION" ] |
| 20 |
[ -n "$$DELTA_NEW_VERSION" ] |
| 21 |
mkdir -p .make-sentinels |
| 22 |
@echo "Release: $$DELTA_OLD_VERSION => $$DELTA_NEW_VERSION" |
| 23 |
|
| 24 |
|
| 25 |
BUMP_VERSION_SENTINEL=.make-sentinels/bump-version |
| 26 |
bump-version: $(BUMP_VERSION_SENTINEL) |
| 27 |
$(BUMP_VERSION_SENTINEL): |
| 28 |
@echo Bumping version in Cargo.toml |
| 29 |
sed -i -E "s,^version = \"$$DELTA_OLD_VERSION\",version = \"$$DELTA_NEW_VERSION\",g" Cargo.toml |
| 30 |
cargo build --release |
| 31 |
git add Cargo.toml Cargo.lock |
| 32 |
git commit -m "Bump version" || true |
| 33 |
touch $(BUMP_VERSION_SENTINEL) |
| 34 |
|
| 35 |
|
| 36 |
CREATE_GITHUB_RELEASE_SENTINEL=.make-sentinels/create-github-release |
| 37 |
create-github-release: $(CREATE_GITHUB_RELEASE_SENTINEL) check-environment |
| 38 |
$(CREATE_GITHUB_RELEASE_SENTINEL): |
| 39 |
@echo \# Creating release tag |
| 40 |
git tag "$$DELTA_NEW_VERSION" |
| 41 |
git push |
| 42 |
git push --tags |
| 43 |
@echo \# See https://github.com/dandavison/delta/releases |
| 44 |
touch $(CREATE_GITHUB_RELEASE_SENTINEL) |
| 45 |
|
| 46 |
|
| 47 |
BUMP_VERSION_IN_DOCUMENTATION_LINKS_SENTINEL=.make-sentinels/bump-version-in-documentation-links |
| 48 |
bump-version-in-documentation-links: $(BUMP_VERSION_IN_DOCUMENTATION_LINKS_SENTINEL) |
| 49 |
$(BUMP_VERSION_IN_DOCUMENTATION_LINKS_SENTINEL): |
| 50 |
sed -i -E "s,$$DELTA_OLD_VERSION,$$DELTA_NEW_VERSION,g" manual/src/full---help-output.md manual/src/installation.md |
| 51 |
rg -qF "$$DELTA_NEW_VERSION" manual/src/installation.md |
| 52 |
git add manual/src/full---help-output.md manual/src/installation.md |
| 53 |
git commit -m "Link to new binaries" |
| 54 |
touch $(BUMP_VERSION_IN_DOCUMENTATION_LINKS_SENTINEL) |
| 55 |
|
| 56 |
|
| 57 |
.PHONY: \ |
| 58 |
clean \ |
| 59 |
release \ |
| 60 |
check_environment \ |
| 61 |
bump-version \ |
| 62 |
create-github-release \ |
| 63 |
bump-version-in-documentation-links |