Skip to content

Commit

Permalink
#5 l3build
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Sep 12, 2022
1 parent 7723b02 commit 3a8ffb4
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 14 deletions.
17 changes: 17 additions & 0 deletions .rultor.yml
@@ -0,0 +1,17 @@
docker:
image: yegor256/rultor-image:1.13.0
install: |-
sudo apt-get install -y python3-pygments
sudo pip3 install pygments
sudo tlmgr option repository ctan
sudo gem install texsc:0.6.0
sudo gem install texqc:0.6.0
sudo apt-get install -y aspell
sudo tlmgr --verify-repo=none update --self
sudo tlmgr --verify-repo=none install l3build
release:
script: |-
make VERSION=${tag} set-version
git commit -am "version set to ${tag}"
make
echo 'y' | l3build upload --halt-on-error
22 changes: 11 additions & 11 deletions Makefile
Expand Up @@ -20,7 +20,7 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

.SHELLFLAGS = -e -x -c
.SHELLFLAGS = -e -x -c -o pipefail
.ONESHELL:

NAME=clicks
Expand All @@ -38,31 +38,31 @@ $(NAME).pdf: $(NAME).tex $(NAME).sty
texsc $<
texqc --ignore 'You have requested document class' $<

set-version:
date=$$(date +%Y/%m/%d)
sed -i "s|0\.0\.0|$(version)|" $(NAME).sty
sed -i "s|00\.00\.0000|$${date}|" $(NAME).sty
sed -i "s|0\.0\.0|$(version)|" $(NAME).tex
sed -i "s|00\.00\.0000|$${date}|" $(NAME).tex

zip: $(NAME).pdf $(NAME).sty
rm -rf package
mkdir package
cd package
mkdir $(NAME)
cd $(NAME)
cp ../../README.md .
version=$$(curl --silent -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/yegor256/$(NAME)/releases/latest | jq -r '.tag_name')
echo "Version is: $${version}"
date=$$(date +%Y/%m/%d)
echo "Date is: $${date}"
cp ../../$(NAME).sty .
gsed -i "s|0\.0\.0|$${version}|" $(NAME).sty
gsed -i "s|00\.00\.0000|$${date}|" $(NAME).sty
cp ../../$(NAME).tex .
gsed -i "s|0\.0\.0|$${version}|" $(NAME).tex
gsed -i "s|00\.00\.0000|$${date}|" $(NAME).tex
cp ../../.latexmkrc .
latexmk -pdf $(NAME).tex
rm .latexmkrc
rm -rf _minted-* *.$(NAME) *.aux *.bbl *.bcf *.blg *.fdb_latexmk *.fls *.log *.run.xml *.out *.exc
cat $(NAME).sty | grep RequirePackage | gsed -e "s/.*{\(.\+\)}.*/hard \1/" > DEPENDS.txt
cat $(NAME).sty | grep RequirePackage | sed -e "s/.*{\(.\+\)}.*/hard \1/" | uniq > DEPENDS.txt
cd ..
zip -r $(NAME).zip *
cp $(NAME).zip ../$(NAME)-$${version}.zip
cp $(NAME).zip ..
unzip -l $(NAME).zip
cd ..

clean:
Expand Down
21 changes: 21 additions & 0 deletions build.lua
@@ -0,0 +1,21 @@
module = "clicks"
uploadconfig = {
update = true,
pkg = "clicks",
version = "0.0.0",
author = "Yegor Bugayenko",
uploader = "Yegor Bugayenko",
email = "yegor256@gmail.com",
note = "Bug fixes",
announcement = "Some non-critical bug fixes",
ctanPath = "/macros/latex/contrib/clicks",
bugtracker = "https://github.com/yegor256/clicks/issues",
home = "https://github.com/yegor256/clicks",
description = "With the help of this package you can simulate animation in your slide deck, making it look similar to what PowerPoint can do.",
development = "https://github.com/yegor256/clicks",
license = "mit",
summary = "Slide Deck Animation",
repository = "https://github.com/yegor256/clicks",
support = "https://github.com/yegor256/clicks",
topic = {"emulation","layout","presentation"}
}
10 changes: 7 additions & 3 deletions clicks.sty
Expand Up @@ -37,19 +37,23 @@

\newcounter{minutes}

% Print the content as is
% Print the content as is.
\makeatletter\newcommand\print[1]{%
\gappto\clicks@body{{#1\par}}%
}\makeatother

% Flush the page: print the entire content.
\makeatletter\newcommand\flush[1][1]{%
\clicks@flush%
\renewcommand*\clicks@body{}%
\ifx\clicks@body\empty\else%
\clicks@flush%
\renewcommand*\clicks@body{}%
\fi%
\ifclicks@static\else%
\addtocounter{minutes}{#1}%
\fi%
}

% Print the content and wait for more.
\makeatletter\newcommand\click[1][0]{%
\ifclicks@static\else%
\addtocounter{minutes}{#1}%
Expand Down

0 comments on commit 3a8ffb4

Please sign in to comment.