From e64e57d728405784336ef037f7b4327fdc19ee88 Mon Sep 17 00:00:00 2001 From: Martin Scheidt Date: Tue, 29 Mar 2022 23:55:43 +0200 Subject: [PATCH] switch for automated CTAN upload to ctan-o-mat --- .github/tex/packages.doc.txt | 1 + .github/tex/tikz-trackschematic.pkg | 125 ++++++++++++++++++++++++++ .github/workflows/ctanvalidation.yaml | 40 --------- .github/workflows/release.yaml | 3 +- build.sh | 40 ++++++--- 5 files changed, 157 insertions(+), 52 deletions(-) create mode 100644 .github/tex/tikz-trackschematic.pkg delete mode 100644 .github/workflows/ctanvalidation.yaml diff --git a/.github/tex/packages.doc.txt b/.github/tex/packages.doc.txt index 33e5ff2..2b97eec 100644 --- a/.github/tex/packages.doc.txt +++ b/.github/tex/packages.doc.txt @@ -1,6 +1,7 @@ ## -- engine used to compile (pdflatex) latex-bin latexmk +ctan-o-mat ## -- direct dependencies tikz-trackschematic diff --git a/.github/tex/tikz-trackschematic.pkg b/.github/tex/tikz-trackschematic.pkg new file mode 100644 index 0000000..a6d062c --- /dev/null +++ b/.github/tex/tikz-trackschematic.pkg @@ -0,0 +1,125 @@ +% This is a description file for ctan-o-mat. +% It manages uploads of a package to +% CTAN -- the Comprehensive TeX Archive Network. +% +% The syntax is roughly oriented towards (La)TeX. +% Two form of the macros are used. The simple macros take one argument +% in braces. Here the argument may not contain embedded macros. +% +% The second form uses an environment enclosed in \begin{}/\end{}. +% In the long text fields logo macros can be used. +% +% You should enter your values between the begin and the end of the +% named type. +% ------------------------------------------------------------------------- +% This field contains the CTAN id of the package. +% The value is optional. +% The value is restricted to 32 characters. +\pkg{tikz-trackschematic} +% ------------------------------------------------------------------------- +% This field contains the version of the package. +% The value is optional. +% The value is restricted to 32 characters. +\version{}%%[SCRIPT] +% ------------------------------------------------------------------------- +% This field contains the name of the author(s). +% The value is optional. +% The value is restricted to 128 characters. +\author{Martin Scheidt} +% ------------------------------------------------------------------------- +% This field contains the email address of the uploader. +% The value is an email address. +% The value is restricted to 255 characters. +\email{m.scheidt@tu-braunschweig.de} +% ------------------------------------------------------------------------- +% This field contains the name of the uploader. +% The value is restricted to 255 characters. +\uploader{Martin Scheidt (via github actions)} +% ------------------------------------------------------------------------- +% This field contains the directory on CTAN. +% The value is optional. +% The value is restricted to 255 characters. +\ctanPath{/graphics/pgf/contrib/tikz-trackschematic} +% ------------------------------------------------------------------------- +% This field contains the license. +% The value is optional. +% The value is restricted to 2048 characters. +% Multiple values are allowed. +\license{isc} +% ------------------------------------------------------------------------- +% This field contains the URL of the home page. +% The value is optional. +% The value is a URL. +% The value is restricted to 255 characters. +% Multiple values are allowed. +\home{https://www.railtoolkit.org/projects/tikz-trackschematic/} +% ------------------------------------------------------------------------- +% This field contains the URL of the bug tracker. +% The value is optional. +% The value is a URL. +% The value is restricted to 255 characters. +% Multiple values are allowed. +\bugtracker{https://github.com/railtoolkit/tikz-trackschematic/issues} +% ------------------------------------------------------------------------- +% This field contains the support channel. +% The value is optional. +% The value is a URL. +% The value is restricted to 255 characters. +% Multiple values are allowed. +\support{} +% ------------------------------------------------------------------------- +% This field contains the version management. +% The value is optional. +% The value is a URL. +% The value is restricted to 255 characters. +% Multiple values are allowed. +\repository{https://github.com/railtoolkit/tikz-trackschematic} +% ------------------------------------------------------------------------- +% This field contains the developer's channel. +% The value is optional. +% The value is a URL. +% The value is restricted to 255 characters. +% Multiple values are allowed. +\development{} +% ------------------------------------------------------------------------- +% This field contains the update indicator; true for update. +% The value is optional. +% The value is restricted to 8 characters. +\update{true} +% ------------------------------------------------------------------------- +% This field contains the topics id. +% The value is optional. +% The value is restricted to 1024 characters. +% Multiple values are allowed. +\topic{} +% ------------------------------------------------------------------------- +% This field contains the text for the mail announcement. +% The value is optional. +% The value is restricted to 8192 characters. +\begin{announcement} + %RELEASE-NOTES%%[SCRIPT] +\end{announcement} +% ------------------------------------------------------------------------- +% This field contains the one-liner for the package. +% The value is optional. +% The value is restricted to 128 characters. +\summary{A TikZ library for creating track diagrams in railways} +% ------------------------------------------------------------------------- +% This field contains the descriptive abstract for the package. +% The value is optional. +% The value is restricted to 4096 characters. +\begin{description} + This TikZ library is a toolbox of symbols geared primarily towards creating track schematic for either research or educational purposes. It provides a TikZ frontend to some of the symbols which may be needed to describe situations and layouts in railway operation. The library is divided into sublibraries: topology, trafficcontrol, vehicles, constructions, electrics, symbology, and measures. +\end{description} +% ------------------------------------------------------------------------- +% This field contains the note to the CTAN upload managers. +% The value is optional. +% The value is restricted to 2048 characters. +\begin{note} + Uploaded automatically by ctan-o-mat (via github actions) +\end{note} +% ------------------------------------------------------------------------- +% This field contains the archive file. +% The value is the file name of the archive to be uploaded. +% It may have a relative or absolute directory. +\file{}%%[SCRIPT] diff --git a/.github/workflows/ctanvalidation.yaml b/.github/workflows/ctanvalidation.yaml deleted file mode 100644 index 560d445..0000000 --- a/.github/workflows/ctanvalidation.yaml +++ /dev/null @@ -1,40 +0,0 @@ -### github action to make and publish a release -## -name: "CTAN upload validation" - -## Controls when the workflow will run -on: - ## Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -## A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - validate: - runs-on: ubuntu-latest - steps: - # 1. checkout the repo - - name: "checkout" - uses: actions/checkout@v2 - - # 2. create package for testing - - name: "create an old tikz-trackschematic package" - run: ./build.sh --non-interactive --release v0.7.0 - - # 3. - - name: CTAN submit validation - uses: paolobrasolin/ctan-submit-action@v1 - with: - file_path: tikz-trackschematic-v0.7.0.zip - version: 1.1 - action: validate - fields: | - pkg: "tikz-trackschematic" - summary: "A TikZ library for creating track diagrams in railways" - description: "This TikZ library is a toolbox of symbols geared primarily towards creating track schematic for either research or educational purposes. It provides a TikZ frontend to some of the symbols which may be needed to describe situations and layouts in railway operation. The library is divided into sublibraries: topology, trafficcontrol, vehicles, constructions, electrics, symbology, and measures." - license: isc - repository: https://github.com/railtoolkit/tikz-trackschematic - author: "Martin Scheidt" - uploader: "Martin Scheidt (via github CI)" - email: m.scheidt@tu-braunschweig.de - update: true - version: v0.7.0 diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 6fe20aa..e84d88b 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -75,4 +75,5 @@ jobs: id: ${{ steps.create_release.outputs.id }} # 6. upload new release to CTAN - ## TODO \ No newline at end of file + - name: CTAN submit + run: ctan-o-mat --verbose --submit .github/tex/tikz-trackschematic.pkg diff --git a/build.sh b/build.sh index 07e174d..975fc4d 100755 --- a/build.sh +++ b/build.sh @@ -568,8 +568,8 @@ create_release_notes() { ## -- 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) + 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 )) @@ -578,6 +578,19 @@ create_release_notes() { sedi "s/###/##/g" release-note-$VERSION_STR.md } +create_ctan_configuration() { + # modify the file .github/tex/tikz-trackschematic.pkg for ctan-o-mat + # 1. replace \version{}%%[SCRIPT] + sed -i".backup" -e"s/version{}%%\[SCRIPT\]/version{$DATE $VERSION_STR}/g" .github/tex/tikz-trackschematic.pkg + + # 2. replace \file{}%%[SCRIPT] + sedi "s/file{}%%\[SCRIPT\]/file{tikz-trackschematic-$VERSION_STR.zip}/g" .github/tex/tikz-trackschematic.pkg + + # 3. replace %RELEASE-NOTES%%[SCRIPT] + awk '/%RELEASE-NOTES%%\[SCRIPT\]/{system("cat release-note-*.md");next}1' .github/tex/tikz-trackschematic.pkg > .github/tex/tikz-trackschematic.tmp.pkg + mv .github/tex/tikz-trackschematic.tmp.pkg .github/tex/tikz-trackschematic.pkg +} + run_compile_documentation() { ## compile order # 1. manual, symbology-table, snippets @@ -909,13 +922,11 @@ cleanup() { ## -- cleanup ## from create_release if [ $CLEANUP = 1 ]; then - if [ $RELEASE = 1 ]; then + + ## from run_test_cases + if [ $TESTING = 1 ]; then # remove TMP-folder - rm -rf $TMP - # undo changes to tikz-trackschematic.sty by sed - mv src/tikz-trackschematic.sty.backup src/tikz-trackschematic.sty - # remove TMP-release-note - rm release-note-tmp.md + rm -rf test/.tex fi ## from check_imagemagick_policy @@ -938,10 +949,16 @@ cleanup() { rm doc/symbology/tmp.tex fi - ## from run_test_cases - if [ $TESTING = 1 ]; then + ## from create_release(_notes) + if [ $RELEASE = 1 ]; then # remove TMP-folder - rm -rf test/.tex + rm -rf $TMP + # undo changes to tikz-trackschematic.sty by sed + mv src/tikz-trackschematic.sty.backup src/tikz-trackschematic.sty + # remove TMP-release-note + rm release-note.tmp.md + # # undo changes to .github/tex/tikz-trackschematic.pkg by sed + # mv .github/tex/tikz-trackschematic.pkg.backup .github/tex/tikz-trackschematic.pkg fi ## @@ -1034,6 +1051,7 @@ if [ $RELEASE = 1 ]; then ## create_release create_release_notes + create_ctan_configuration fi ##