-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix
cppo -version
and improve make release
This commit fixes issue #92 and proposes an improved command `make release VERSION=X.Y.Z` which creates and publishes a new release.
- Loading branch information
Showing
5 changed files
with
57 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,67 @@ | ||
.PHONY: all clean test check install uninstall release | ||
|
||
all: | ||
@dune build | ||
|
||
clean: | ||
@git clean -fX | ||
|
||
test: | ||
@dune runtest | ||
|
||
check: test | ||
|
||
install: | ||
@dune install | ||
|
||
uninstall: | ||
@dune uninstall | ||
|
||
check: test | ||
|
||
.PHONY: clean all check test install uninstall | ||
|
||
clean: | ||
dune clean | ||
|
||
# To make a release: | ||
# + check that [make] and [make test] succeed | ||
# + check that everything has been committed | ||
# + check that [make test] succeeds | ||
# + check that everything has been committed and pushed | ||
# + check that the CI has succeeded | ||
# + check that [opam lint] is happy | ||
# + make sure that the package is not pinned: [opam pin remove cppo] | ||
# + create a tag, e.g. [git tag vX.Y.Z] | ||
# (the tag should not be annotated, as it shows up in [cppo -version]) | ||
# + run [make publishX.Y.Z] | ||
# + run [make release VERSION=X.Y.Z] | ||
|
||
publish%: | ||
opam publish --tag=v$* -v $* ocaml-community/cppo | ||
release: | ||
# Check if this is the master branch. | ||
@ if [ "$$(git symbolic-ref --short HEAD)" != "master" ] ; then \ | ||
echo "Error: this is not the master branch." ; \ | ||
git branch ; \ | ||
exit 1 ; \ | ||
fi | ||
# Check if everything has been committed. | ||
@ if [ -n "$$(git status --porcelain)" ] ; then \ | ||
echo "Error: there remain uncommitted changes." ; \ | ||
git status ; \ | ||
exit 1 ; \ | ||
fi | ||
# Make sure the current version can be compiled. | ||
@ make clean | ||
@ make test | ||
# Check the current package description. | ||
@ opam lint | ||
# Make sure $(VERSION) is nonempty. | ||
@ if [ -z "$(VERSION)" ] ; then \ | ||
echo "Error: please use: make release VERSION=X.Y.Z" ; \ | ||
exit 1 ; \ | ||
fi | ||
# Make sure a CHANGES entry with the current version seems to exist. | ||
@ if ! grep "## v$(VERSION)" Changes.md >/dev/null ; then \ | ||
echo "Error: Changes.md has no entry for version $(VERSION)." ; \ | ||
exit 1 ; \ | ||
fi | ||
# Make sure the current version is mentioned in dune-project. | ||
@ if ! grep "(version $(VERSION))" dune-project >/dev/null ; then \ | ||
echo "Error: dune-project does not mention version $(VERSION)." ; \ | ||
grep "(version" dune-project ; \ | ||
exit 1 ; \ | ||
fi | ||
# Create a git tag. | ||
@ git tag -v$(VERSION) | ||
# Upload. (This automatically makes a .tar.gz archive available on github.) | ||
@ git push | ||
@ git push --tags | ||
# Publish an opam description. | ||
@ opam publish --tag=v$(VERSION) -v $(VERSION) ocaml-community/cppo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
(lang dune 2.0) | ||
(name cppo) | ||
(version 1.7.0) | ||
|
||
(generate_opam_files true) | ||
|
||
|