Better version management
This commit is contained in:
parent
7eb6167eb8
commit
60e4d3ec6e
|
@ -139,11 +139,20 @@ the textual mode and see if the output is valid SVG.
|
|||
|
||||
## Development
|
||||
|
||||
Development happens mostly on the `develop` branch, which is released on MELPA at every commit. The `master` branch is used to generate tags which are then released to [MELPA
|
||||
stable](https://stable.melpa.org).
|
||||
|
||||
In order to contribute to `plantuml-mode` make sure to:
|
||||
|
||||
- agree with the [GPLv3+ licencing terms](#License) as they are mandated by Emacs
|
||||
- install [`cask`](https://github.com/cask/cask)
|
||||
- always test your code and run the full test suite with `cask exec ert-runner` (or just by `make`)
|
||||
- ensure you always target `develop` in your pull requests
|
||||
|
||||
For collaborators who have merge access to the repo:
|
||||
- make sure [`set-version.sh`](./blob/develop/bin/set-version.sh) is run as part of your [`pre-commit` git hooks](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks)
|
||||
- always merge PRs on the command line
|
||||
- when releasing a new stable version, add the proper entry in the changelog within `plantuml-mode.el` to ensure the right version is set for `plantuml-mode-version`
|
||||
|
||||
# Credits
|
||||
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Retrieves the version from the changelog in plantuml-mode.el
|
||||
function grab_version(){
|
||||
grep ';; version' plantuml-mode.el | \
|
||||
head -n1 | \
|
||||
cut -f3 -d' ' | \
|
||||
tr -d ','
|
||||
}
|
||||
|
||||
# Updates the version in-place
|
||||
function update_version(){
|
||||
NEW_VERSION="${1}"
|
||||
sed -i -E "s/plantuml-mode-version \"[1-9\.]+\"/plantuml-mode-version \"${1}\"/" plantuml-mode.el
|
||||
}
|
||||
|
||||
case "$(git rev-parse --abbrev-ref HEAD)" in
|
||||
'master')
|
||||
VERSION="$(grab_version)"
|
||||
update_version "${VERSION}"
|
||||
git add plantuml-mode.el
|
||||
;;
|
||||
|
||||
'develop')
|
||||
VERSION="$(date '+%Y%m%d.%H%M')" # MELPA style
|
||||
update_version "${VERSION}"
|
||||
git add plantuml-mode.el
|
||||
;;
|
||||
|
||||
*)
|
||||
## do nothing
|
||||
;;
|
||||
esac
|
|
@ -92,7 +92,7 @@
|
|||
|
||||
(defvar plantuml-mode-hook nil "Standard hook for plantuml-mode.")
|
||||
|
||||
(defconst plantuml-mode-version "1.3.1" "The plantuml-mode version string.")
|
||||
(defconst plantuml-mode-version "20190821.1053" "The plantuml-mode version string.")
|
||||
|
||||
(defvar plantuml-mode-debug-enabled nil)
|
||||
|
||||
|
|
Loading…
Reference in New Issue