diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index f18c1fc..02e38ec 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -37,7 +37,7 @@ jobs: with: tag_name: ${{ github.ref }} release_name: Release ${{ github.ref }} - body: "release information" + body_path: release-note-${{ steps.tag.outputs.tag }}.md draft: false prerelease: false diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..375d810 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,149 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +Categories: Added, Changed, Deprecated, Removed, Fixed, and Security. + +## [Unreleased] + +### Added + + * interlocking symbols for other than manual interlockings + * i18n support + +### Changed + + * transmitters for balises + + +## Version [0.6.3] - 2022-02-15 + +### Added + + * anchor for SVG export + * automated testing and releasing + * separate changelog + +### Fixed + + * documented (slip-)turnout option: points=moving + * spelling error in documentation + * URL to signalschablone + + +## Version [0.6.2] - 2021-10-15 + +### Fixed + + * runaway argument + * developer mode always on + + +## Version [0.6.1] - 2021-09-30 + +### Added + + * added citation information + +### Removed + + * removed package requirement lmodern + +### Fixed + + * minor correction in manual + + +## Version [0.6] - 2021-01-02 + +### Added + + * created an encapsulating package for future flexibility + * added symbols for direction control, track marking, pylons and electric wiring + +### Changed + + * changed symbol for friction bufferstop; + * changed load command to \usepackage{tikz-trackschematic} + + +## Version [0.5.1] - 2020-02-10 + +### Added + + * added symbols "braking point" and "danger point" + +### Changed + + * modified symbol "end of movement authority" + + +## Version [0.5] - 2020-01-14 + +### Added + + * documentation + +### Changed + + * new improved syntax for topology + + +## Version [0.4] - 2019-07-21 + +### Added + + * added document for symbology + +### Changed + + * renamed overview to snippets + * reworked library for common tikz library layout + + +## Version [0.3] - 2019-04-04 + +### Added + + * added shunting movements + * added points to turnouts + * added moving trains + * defined and used color foreground and background + +### Changed + + * moved snippet folder to root folder + + +## Version [0.2] - 2018-12-19 + +### Added + + * added transmitters + +### Changed + + * reorganized src library + * minor improvements + + +## Version [0.1] - 2018-09-14 + +### Added + + Basic concept of a library with railway topology symbols and some examples. + + +[Unreleased]: https://github.com/railtoolkit/tikz-trackschematic/compare/v0.6.3...master +[0.6.3]: https://github.com/railtoolkit/tikz-trackschematic/compare/v0.6.2...v0.6.3 +[0.6.2]: https://github.com/railtoolkit/tikz-trackschematic/compare/v0.6.1...v0.6.2 +[0.6.1]: https://github.com/railtoolkit/tikz-trackschematic/compare/v0.6...v0.6.1 +[0.6]: https://github.com/railtoolkit/tikz-trackschematic/compare/v0.5.1...v0.6 +[0.5.1]: https://github.com/railtoolkit/tikz-trackschematic/compare/v0.5...v0.5.1 +[0.5]: https://github.com/railtoolkit/tikz-trackschematic/compare/v0.4...v0.5 +[0.4]: https://github.com/railtoolkit/tikz-trackschematic/compare/v0.3...v0.4 +[0.3]: https://github.com/railtoolkit/tikz-trackschematic/compare/v0.2...v0.3 +[0.2]: https://github.com/railtoolkit/tikz-trackschematic/compare/v0.1...v0.2 +[0.1]: https://github.com/railtoolkit/tikz-trackschematic/releases/tag/v0.1 \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 34c1a8a..8817478 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -9,10 +9,10 @@ Please note we have a code of conduct, please follow it in all your interactions 1. Ensure any install or build dependencies are removed before the end of the layer when doing a build. -2. Update the README.md with details of changes to the interface, this includes new environment +2. Update the CHANGELOG.md with details of changes to the interface, this includes new environment variables, exposed ports, useful file locations and container parameters. 3. The versioning scheme we use is [SemVer](http://semver.org/). Increase the version numbers in the following files to the new version that this Pull Request would represent: - 1. README.md + 1. CHANGELOG.md 2. doc/versionhistory.tex 4. You may merge the Pull Request in once you have the sign-off of two other developers, or if you do not have permission to do that, you may request the second reviewer to merge it for you. diff --git a/README.md b/README.md index 9adbe49..93708e0 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,8 @@ The library can then be loaded through the command ``` in any LaTeX file. +The library can also be used in [Overleaf](https://www.overleaf.com/read/crrxfcdzbhbd). + ------------ # Minimal working example @@ -54,8 +56,6 @@ results in: ![train on a track](https://raw.githubusercontent.com/railtoolkit/tikz-trackschematic/master/doc/examples/minimal_working_example.png "train on a track") -The library can also be used in [Overleaf](https://www.overleaf.com/read/crrxfcdzbhbd). - ------------ # Symbology and meaning @@ -64,68 +64,6 @@ Please consult the [symbology table](https://github.com/railtoolkit/tikz-tracksc ------------ -# History - -## Version 0.6.3 - - ADDED: anchor for SVG export - FIXED: documented (slip-)turnout option: points=moving - FIXED: spelling error in documentation - -## Version 0.6.2 - - bug fixing - -## Version 0.6.1 - - * removed package requirement lmodern - * minor correction in manual - * added citation information - -## Version 0.6 - - * created an encapsulating package for future flexibility - * added symbols for direction control, track marking, pylons and electric wiring - * change symbol for friction bufferstop; - * changed load command to \usepackage{tikz-trackschematic} - -## Version 0.5.1 - - * modified symbol "end of movement authority" - * added symbols "braking point" and "danger point" - -## Version 0.5 - - * new improved syntax for topology - * documentation - -## Version 0.4 - - * added document for symbology - * renamed overview to snippets - * reworked library for common tikz library layout - -## Version 0.3 - - * moved snippet folder to root folder - * added shunting movements - * added points to turnouts - * added moving trains - * defined and used color foreground and background - - -## Version 0.2 - - * added transmitters - * reorganized src library - * minor improvements - -## Version 0.1 - - Basic concept of a library with railway topology symbols and some examples. - ------------- - # Roadmap * rethink syntax diff --git a/create-release.sh b/create-release.sh index 8906fa2..5caf658 100755 --- a/create-release.sh +++ b/create-release.sh @@ -59,19 +59,19 @@ RELEASE="tikz-trackschematic-$VERSION_STR" ## -- commands -check_readme() { - # check if $VERSION is present in README.md +# check for zip +check_zip() { status=0 - grep -qs "Version $VERSION_NUM" README.md || status=1 + command -v zip >/dev/null 2>&1 || status=1 if [ $status = 0 ]; then if [ $verbose = 1 ]; then - echo "Version $VERSION_NUM is present in README.md." + echo "zip found" fi return 0 fi - echo "Version $VERSION_NUM not found in README.md." - echo "Be sure to edit README.md and specify current version!" + echo "Program 'zip' not found." + echo "Be sure to have zip installed!" exit 1 } @@ -91,49 +91,116 @@ check_versionhistory() { exit 1 } -# check for zip -check_zip() { +check_changelog() { + # check if $VERSION is present in CHANGELOG.md status=0 - command -v zip >/dev/null 2>&1 || status=1 + grep -qs "Version \[$VERSION_NUM\]" CHANGELOG.md || status=1 if [ $status = 0 ]; then if [ $verbose = 1 ]; then - echo "zip found" + echo "Version $VERSION_NUM is present in CHANGELOG.md." fi return 0 fi - echo "Program 'zip' not found." - echo "Be sure to have zip installed!" + echo "Version $VERSION_NUM not found in CHANGELOG.md." + echo "Be sure to edit CHANGELOG.md and specify current version!" exit 1 } +check_date() { + ## extract DATE from versionhistory.tex and CHANGELOG.md + LINE_1=$(grep "vhEntry{$VERSION_NUM" doc/versionhistory.tex) + LINE_2=$(grep "Version \[$VERSION_NUM\]" CHANGELOG.md) + DATEISO_1=$(echo $LINE_1 | egrep -o '[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])') + DATEISO_2=$(echo $LINE_2 | egrep -o '[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])') + + if [ $DATEISO_1 = $DATEISO_2 ]; then + # DATE=$(echo $DATEISO | sed -e "s|-|\\\/|g") # with escape character for sed + # DATE=$(date "+%Y\/%m\/%d") # with escape character for sed + DATE="$DATEISO_1" + if [ $verbose = 1 ]; then + echo "The date $DATE was extracted from versionhistory.tex and CHANGELOG.md." + fi + return 0 + fi + + echo "The date in versionhistory.tex and CHANGELOG.md did not match." + echo "Be sure to edit versionhistory.tex or CHANGELOG.md and modifiy the date!" + exit 1 +} + +check_url1() { + ## extract urls from CHANGELOG.md + status=0 + LINE=$(grep "\[$VERSION_NUM\]: https://" CHANGELOG.md) + echo $LINE | grep -qs "...$VERSION_STR" || status=1 + if [ $status = 0 ]; then + if [ $verbose = 1 ]; then + echo "Version $VERSION_NUM URL is present in CHANGELOG.md." + fi + return 0 + fi + + echo "Version $VERSION_NUM URL was not found in CHANGELOG.md." + echo "Be sure to edit CHANGELOG.md and specify a URL for the current version!" + exit 1 +} + +check_url2() { + ## extract urls from CHANGELOG.md + status=0 + LINE=$(grep "\[Unreleased\]: https://" CHANGELOG.md) + echo $LINE | grep -qs "/$VERSION_STR..." || status=1 + if [ $status = 0 ]; then + if [ $verbose = 1 ]; then + echo "The URL for [Unreleased] was also updated in CHANGELOG.md! Thx!" + fi + return 0 + fi + + echo "WARNING: URL for [Unreleased] in CHANGELOG.md does not reflect the current version $VERSION_NUM." + echo "WARNING: Be sure to edit CHANGELOG.md and specify current version!" + + if [ "$batch_mode" -eq 0 ]; then + echo "Do you wish to continue without updated URL for [Unreleased]?" + echo $n "(y/n) $c" + while true; do + read -p "" answer + case $answer in + [Yy]* ) break;; + [Nn]* ) exit 1;; + * ) echo "Please answer yes or no.";; + esac + done + else + echo "ERROR: Aborting in batch mode!" + exit 1 + fi +} + ## -- creating the release -## check if $VERSION is present in README.md and versionhistory.tex -check_readme -check_versionhistory +## check for installed software check_zip -## extract DATE from versionhistory.tex -LINE=$(grep "vhEntry{$VERSION_NUM" doc/versionhistory.tex) -DATEISO=$(echo $LINE | egrep -o '[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])') -# DATE=$(echo $DATEISO | sed -e "s|-|\\\/|g") # with escape character for sed -# DATE=$(date "+%Y\/%m\/%d") # with escape character for sed -if [ $verbose = 1 ]; then - echo "The date $DATEISO was extracted from versionhistory.tex." -fi +## check if $VERSION is present in README.md and versionhistory.tex +check_versionhistory +check_changelog +check_date +check_url1 +check_url2 ## create backup-file und update VERSIONDATE in tikz-trackschematic.sty -sed -i".backup" -e"s/VERSIONDATE/$DATEISO/g" src/tikz-trackschematic.sty +sed -i".backup" -e"s/VERSIONDATE/$DATE/g" src/tikz-trackschematic.sty sedi "/create-release/d" src/tikz-trackschematic.sty if [ $verbose = 1 ]; then echo "Updated version in src/tikz-trackschematic.sty" fi -## (OPTIONAL) recompile manual.tex, examples, symboly_table and snippets.tex` +## -- (OPTIONAL) recompile manual.tex, examples, symboly_table and snippets.tex` -## create zip-archive +## -- create zip-archive # create temporary folder TMP=$RELEASE mkdir -p $TMP @@ -176,12 +243,25 @@ if [ $verbose = 1 ]; then fi -## cleanup +## -- create release note as excerpt from CHANGELOG.md +# determine beginning and end in CHANGELOG.md +TOP=$(grep -n "Version \[$VERSION_NUM\]" CHANGELOG.md | cut -d: -f1) +awk "NR>$TOP" CHANGELOG.md > release-note-tmp.md +BOTTOM=$(grep -n -m 1 "## Version" release-note-tmp.md | cut -d: -f1) +BOTTOM=$(( $TOP + $BOTTOM )) +BOTTOM=$(( $BOTTOM - 2 )) +TOP=$(( $TOP + 1 )) +# extract the excerpt +awk "NR>$TOP&&NR<$BOTTOM" CHANGELOG.md > release-note-$VERSION_STR.md +sedi "s/###/#/g" release-note-$VERSION_STR.md + + +## -- cleanup # remove TMP-folder -rm -rf $TMP/* -rmdir $TMP +rm -rf $TMP # undo changes to tikz-trackschematic.sty by sed mv src/tikz-trackschematic.sty.backup src/tikz-trackschematic.sty +rm release-note-tmp.md if [ $verbose = 1 ]; then echo "clean up done!" fi \ No newline at end of file diff --git a/doc/versionhistory.tex b/doc/versionhistory.tex index 643ca81..f27cc5a 100644 --- a/doc/versionhistory.tex +++ b/doc/versionhistory.tex @@ -33,7 +33,7 @@ \vhEntry{0.6.2}{2021-10-15}{MS}{ bug fixing } - \vhEntry{0.6.3}{2022-02-02}{MS|GW}{ - fixed spelling error and documented (slip-)turnout option: points=moving + \vhEntry{0.6.3}{2022-02-15}{MS|GW}{ + fixed spelling error and documented (slip-)turnout option: points=moving; updated link to signalschablone; automated testing and releasing } \end{versionhistory}