Skip to content
Snippets Groups Projects
Commit 187b4f63 authored by Julien Girard-Satabin's avatar Julien Girard-Satabin Committed by Michele Alberti
Browse files

[release] Automatize changing versions in manual and src

parent 76414c69
No related branches found
No related tags found
No related merge requests found
variables: variables:
CAISAR_VERSION: "2.0.0" CAISAR_VERSION: "2.0.0"
TAG: "2.0" TAG: "2.0.0"
default: default:
interruptible: true interruptible: true
......
...@@ -45,6 +45,8 @@ release: ...@@ -45,6 +45,8 @@ release:
@echo -n $(DESCRIPTION) @echo -n $(DESCRIPTION)
@echo "Is the CHANGES.md correct for $(TAG) (y/n)?" @echo "Is the CHANGES.md correct for $(TAG) (y/n)?"
@read yesno; test "$$yesno" = y @read yesno; test "$$yesno" = y
echo $(TAG) > VERSION
./update_version.sh
dune-release tag $(TAG) dune-release tag $(TAG)
dune-release distrib --skip-build --skip-lint dune-release distrib --skip-build --skip-lint
curl --header "PRIVATE-TOKEN: $(GITLAB_TOKEN)" \ curl --header "PRIVATE-TOKEN: $(GITLAB_TOKEN)" \
......
...@@ -29,9 +29,9 @@ author = 'The CAISAR Development Team' ...@@ -29,9 +29,9 @@ author = 'The CAISAR Development Team'
# built documents. # built documents.
# #
# The short X.Y version. # The short X.Y version.
version = '2.0' version = '2.0.0'
# The full version, including alpha/beta/rc tags. # The full version, including alpha/beta/rc tags.
release = '2.0' release = '2.0.0'
# -- General configuration --------------------------------------------------- # -- General configuration ---------------------------------------------------
......
...@@ -433,7 +433,7 @@ let default_info = ...@@ -433,7 +433,7 @@ let default_info =
`P "Submit bug reports to https://git.frama-c.com/pub/caisar/issues"; `P "Submit bug reports to https://git.frama-c.com/pub/caisar/issues";
] ]
in in
let version = "1.0" in let version = "2.0.0" in
let exits = Cmd.Exit.defaults in let exits = Cmd.Exit.defaults in
Cmd.info caisar ~version ~doc ~sdocs ~exits ~man Cmd.info caisar ~version ~doc ~sdocs ~exits ~man
......
#!/usr/bin/env bash
set -xe
NEW_DATE=$(date "+%Y")
OLD_DATE=$(date -d '1 year ago' "+%Y")
find . \( -type d -name .git -prune \) \( -type d -name ._build -prune \) -o -type f -print0 | xargs -0 sed -i 's/(C) '${OLD_DATE}'/(C) '${NEW_DATE}'/g'
#!/usr/bin/env bash
set -xe
# Update headers in source files to match current year
NEW_DATE=$(date "+%Y")
OLD_DATE=$(date -d '1 year ago' "+%Y")
find . \( -type d -name .git -prune \) \( -type d -name ._build -prune \) -o -type f -print0 | xargs -0 sed -i 's/(C) '${OLD_DATE}'/(C) '${NEW_DATE}'/g'
# Update version in manual, ci and main.ml according to the VERSION file
VERSION=$(cat VERSION)
sed -E -i 's/let version = "([0-9]\.)+[0-9]" in/let version = "2.0.0" in/g' src/main.ml
sed -E -i 's/version = \x27([0-9]\.)+[0-9]\x27/version = \x27'${VERSION}'\x27/g' doc/conf.py
sed -E -i 's/release = \x27([0-9]\.)+[0-9]\x27/release = \x27'${VERSION}'\x27/g' doc/conf.py
sed -E -i 's/CAISAR_VERSION: "([0-9]\.)+[0-9]"/CAISAR_VERSION: "'${VERSION}'"/g' .gitlab-ci.yml
sed -E -i 's/TAG: "([0-9]\.)+[0-9]"/TAG: "'${VERSION}'"/g' .gitlab-ci.yml
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment