Skip to content
This repository has been archived by the owner on Feb 27, 2024. It is now read-only.

Commit

Permalink
Merge pull request #15 from iqm-finland/comp-690-take-ownership
Browse files Browse the repository at this point in the history
Format changelog.
  • Loading branch information
q-mat-beu authored Aug 11, 2023
2 parents bcce525 + fb48e39 commit e606903
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 11 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,56 +2,70 @@
Changelog
=========

Version 0.3.1 (2023-08-11)
--------------------------

* Format changelog.

Version 0.3.0 (2023-08-11)
--------------------------

* Adapt project to IQM code style.


Version 0.2.13 (2023-02-21)
---------------------------

* Fix static file path generation when one global copy of static files is used (with flag ``--dev-name``).


Version 0.2.12 (2023-02-08)
---------------------------

* Reduce docs size.


Version 0.2.11 (2023-02-02)
---------------------------

* Reduce docs size.


Version 0.2.10 (2023-01-13)
---------------------------

* Try extracting the version from the git tag if it exists and sort based on that. Clients can configure an optional ``smv_symver_pattern`` if default patter is not suitable.


Version 0.2.9 (2023-01-05)
--------------------------

* Skip a build when output directory exists with flag ``--skip-if-outputdir-exists``.


Version 0.2.8 (2022-07-20)
--------------------------

* Build development version of docs from current directory with ``--dev-name`` and ``--dev-path``.


Version 0.2.7 (2022-07-20)
--------------------------

* Detect latest release, generate HTML redirection page.


Version 0.2.6 (2022-06-10)
--------------------------

* Keep track of released versions
* Pass `smv_latest_version` explicitly when calling Sphinx builder.
* Generate a HTML page which redirects to the latest version of docs.


Version 0.2.5 (2022-06-10)
--------------------------

* The original repo seems to be no longer maintained. There were new commits since the latest release `0.2.4`; this release includes all of them.
* When reading metadata from `conf.py`, value `release` is now set to the name of git reference point.

Expand Down
18 changes: 7 additions & 11 deletions tag-from-pipeline.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -10,41 +10,37 @@ function get_version_in_changelog() {
version_line=$(sed "${i}q;d" CHANGELOG.rst) # Get ith line of file
set -- $version_line
version=$2
if [[ $version =~ ^[0-9]+\.[0-9]+$ ]]; then
if [[ $version =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo $version $3
return
fi
done
if [[ ! $version ]]
then
printf "\033[0;31mChangelog file is incorrect, one of the first seven lines should be of the format 'Version xx.xx.'\033[0m";
printf "\033[0;31mChangelog file is incorrect, one of the first seven lines should be of the format 'Version xx.xx.xx (YYYY-MM-DD)'\033[0m";
return 171
fi
}

function verify_changelog_version() {
read -r version date < <(get_version_in_changelog)
current_version=$(git tag -l --sort=-version:refname | grep -E "^[0-9]+(\.[0-9]){1,2}$" | head -n 1)
if version_gt "$current_version" "$version"; then
current_version=$(git tag -l --sort=-version:refname | grep -E "^v[0-9]+(\.[0-9]){1,2}$" | head -n 1)
if version_gt "$current_version" "v$version"; then
printf "\033[0;31mNew version in the changelog (%s) should be greater than the current version (%s).\n\033[0m" "$version" "$current_version";
return 172
fi
if [ $(git tag -l "$version") ]; then
printf "Version %s already exists.\n" "$version";
return 172
fi
printf "Current version is %s, new version is %s.\n" "$current_version" "$version";
printf "Current version is %s, new version is v%s.\n" "$current_version" "$version";
}

function create_new_tag() {
read -r version date < <(get_version_in_changelog)
if [ -n "$date" ]; then
printf "\033[0;33mWarning: content found after the version number, not releasing a new version.\n\033[0m";
return 173
fi
# Only tag if version doesn't exist yet
if ! [ $(git tag -l "$version") ]; then
printf "Releasing version %s.\n" "$version"
if ! [ $(git tag -l "v$version") ]; then
printf "Releasing version v%s.\n" "$version"
curl -X POST -H "Authorization: token $GITHUB_TOKEN" "https://api.github.com/repos/$GITHUB_REPOSITORY/releases" \
-d "{\"tag_name\": \"$version\", \"name\": \"$version\", \"body\": \"Changelog: https://github.com/$GITHUB_REPOSITORY/blob/master/CHANGELOG.rst\"}"
fi
Expand Down

0 comments on commit e606903

Please sign in to comment.