Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
caisar
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
caisar
Commits
8a695dc2
Commit
8a695dc2
authored
8 months ago
by
Julien Girard-Satabin
Committed by
Michele Alberti
8 months ago
Browse files
Options
Downloads
Patches
Plain Diff
[wip] A bit cleaner version update script
parent
0ba93061
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitlab-ci.yml
+1
-1
1 addition, 1 deletion
.gitlab-ci.yml
Makefile
+2
-4
2 additions, 4 deletions
Makefile
doc/conf.py
+1
-1
1 addition, 1 deletion
doc/conf.py
update_version.sh
+21
-5
21 additions, 5 deletions
update_version.sh
with
25 additions
and
11 deletions
.gitlab-ci.yml
+
1
−
1
View file @
8a695dc2
variables
:
variables
:
CAISAR_VERSION
:
"
2.0
.0
"
CAISAR_VERSION
:
"
2.0"
TAG
:
"
2.0.0"
TAG
:
"
2.0.0"
default
:
default
:
...
...
This diff is collapsed.
Click to expand it.
Makefile
+
2
−
4
View file @
8a695dc2
...
@@ -36,21 +36,19 @@ view-doc: doc
...
@@ -36,21 +36,19 @@ view-doc: doc
###################################
###################################
PROJECT_ID
=
1082
PROJECT_ID
=
1082
TAG
=
$(
shell dune-release tag
-f
--yes
>
/dev/null 2>&1
&&
git describe
--tags
--abbrev
=
0
)
PKG
=
"caisar-
$(
TAG
)
.tbz"
PKG
=
"caisar-
$(
TAG
)
.tbz"
REG_VERSION
=
$(
cat
VERSION
)
REG_VERSION
=
$(
cat
VERSION
)
PACKAGE_URL
=
"https://git.frama-c.com/api/v4/projects/
$(
PROJECT_ID
)
/packages/generic/caisar/
$(
TAG
)
/
$(
PKG
)
"
PACKAGE_URL
=
"https://git.frama-c.com/api/v4/projects/
$(
PROJECT_ID
)
/packages/generic/caisar/
$(
TAG
)
/
$(
PKG
)
"
DESCRIPTION
=
"
$(
shell sed -n -e "
p
;
n
;
:next
;
/^##/Q
;
p
;
n
;
b next
" CHANGES.md | perl -pe 's/
\n
/
\\
n/'
)
"
DESCRIPTION
=
"
$(
shell sed -n -e "
p
;
n
;
:next
;
/^##/Q
;
p
;
n
;
b next
" CHANGES.md | perl -pe 's/
\n
/
\\
n/'
)
"
release
:
release
:
@
echo
"
Are git tag
$(
TAG
)
and VERSION file
$(
REG_VERSION
)
the same
? (y/n)?"
@
echo
"
Read
$(
REG_VERSION
)
from VERSION file. Proceed to release CAISAR with this version
? (y/n)?"
@
read
yesno
;
test
"
$$
yesno"
=
y
@
read
yesno
;
test
"
$$
yesno"
=
y
./update_version.sh
./update_version.sh
@
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
dune-release tag
$(
REG_VERSION
)
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
)
"
\
--upload-file
_build/
$(
PKG
)
\
--upload-file
_build/
$(
PKG
)
\
...
...
This diff is collapsed.
Click to expand it.
doc/conf.py
+
1
−
1
View file @
8a695dc2
...
@@ -29,7 +29,7 @@ author = 'The CAISAR Development Team'
...
@@ -29,7 +29,7 @@ author = 'The CAISAR Development Team'
# built documents.
# built documents.
#
#
# The short X.Y version.
# The short X.Y version.
version
=
'
2.0
.0
'
version
=
'
2.0
'
# The full version, including alpha/beta/rc tags.
# The full version, including alpha/beta/rc tags.
release
=
'
2.0.0
'
release
=
'
2.0.0
'
...
...
This diff is collapsed.
Click to expand it.
update_version.sh
+
21
−
5
View file @
8a695dc2
#!/usr/bin/env bash
#!/usr/bin/env bash
# set -xe
set
-xe
if
!
test
-f
VERSION
;
then
echo
"This script must be run from CAISAR root directory."
exit
2
fi
# Update headers in source files to match current year
# Update headers in source files to match current year
NEW_DATE
=
$(
date
"+%Y"
)
NEW_DATE
=
$(
date
"+%Y"
)
OLD_DATE
=
$(
date
-d
'1 year ago'
"+%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'
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
# Update version in manual, ci and
dune-project
according to the VERSION file
VERSION
=
$(
cat
VERSION
)
VERSION
=
$(
cat
VERSION
)
sed
-E
-i
's/let version = "([0-9]\.)+[0-9]" in/let version = "2.0.0" in/g'
src/main.ml
MAJOR
=
$(
echo
"
$VERSION
"
|
awk
-F
'.'
'{print $1}'
)
sed
-E
-i
's/version = \x27([0-9]\.)+[0-9]\x27/version = \x27'
${
VERSION
}
'\x27/g'
doc/conf.py
MINOR
=
$(
echo
"
$VERSION
"
|
awk
-F
'.'
'{print $2}'
)
REV
=
$(
echo
"
$VERSION
"
|
awk
-F
'.'
'{print $3}'
)
MAJOR_MINOR
=
${
MAJOR
}
.
${
MINOR
}
echo
"Updating CAISAR version number to
$VERSION
"
.
sed
-E
-i
's/let version = "([0-9]\.)+[0-9]" in/let version = "'
${
VERSION
}
'" in/g'
src/main.ml
echo
"Changing version in CAISAR's manual."
sed
-E
-i
's/version = \x27([0-9]\.)+[0-9]\x27/version = \x27'
${
MAJOR_MINOR
}
'\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/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
echo
"Changing version in CAISAR's CI."
sed
-E
-i
's/CAISAR_VERSION: "([0-9]\.)+[0-9]"/CAISAR_VERSION: "'
${
MAJOR_MINOR
}
'"/g'
.gitlab-ci.yml
sed
-E
-i
's/TAG: "([0-9]\.)+[0-9]"/TAG: "'
${
VERSION
}
'"/g'
.gitlab-ci.yml
sed
-E
-i
's/TAG: "([0-9]\.)+[0-9]"/TAG: "'
${
VERSION
}
'"/g'
.gitlab-ci.yml
echo
"Changing version in dune-project."
sed
-E
-i
's/version ([0-9]\.)+[0-9]/version '
${
MAJOR_MINOR
}
'/g'
dune-project
# Update version in tests
# Update version in tests
echo
"Changing version in dune tests."
sed
-E
-i
's/([0-9]\.)+[0-9]/'
${
VERSION
}
'/g'
tests/help.t
sed
-E
-i
's/([0-9]\.)+[0-9]/'
${
VERSION
}
'/g'
tests/help.t
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment