Skip to content

Commit

Permalink
Merge branch 'devel' into mandate_tech_chal
Browse files Browse the repository at this point in the history
  • Loading branch information
akinobu1998 committed Feb 13, 2024
2 parents e8e2809 + 26568d9 commit 8d201f6
Show file tree
Hide file tree
Showing 28 changed files with 622 additions and 100 deletions.
67 changes: 30 additions & 37 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ on: [push, pull_request]

jobs:
lint:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: LaTeX linter (chktex)
Expand All @@ -16,83 +14,78 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build-rulebook:

runs-on: ubuntu-latest
container: leplusorg/latex:latest

steps:
- uses: actions/checkout@v4
- name: LaTeX compilation
run:
TERM=xterm make dorulebookonly
- name: Upload build result
uses: actions/upload-artifact@v4
with:
name: rulebook
path: rulebook.pdf


build-scoresheets:

build:
name: build-${{ matrix.document }}
runs-on: ubuntu-latest
container: leplusorg/latex:latest
needs: [lint]
strategy:
fail-fast: false
matrix:
document: [organization, rulebook, scoresheets]

steps:
- uses: actions/checkout@v4
- name: LaTeX compilation
run:
TERM=xterm make doscoresheetsonly
TERM=xterm make do${{ matrix.document }}only
- name: Upload build result
uses: actions/upload-artifact@v4
with:
name: score_sheets
path: score_sheets.pdf
name: ${{ matrix.document }}
path: ${{ matrix.document }}.pdf

deploy-pdfs:

name: deploy-pdfs
runs-on: ubuntu-latest
permissions:
contents: write
needs: [build-rulebook, build-scoresheets]
needs: [build]
steps:
- uses: actions/checkout@v4
with:
ref: gh-pages
- name: Download organization
uses: actions/download-artifact@v4
with:
name: organization
path: ${{ runner.temp }}/organization
- name: Download rulebook
uses: actions/download-artifact@v4
with:
name: rulebook
path: ${{ runner.temp }}/rulebook
- name: Download score sheets
- name: Download scoresheets
uses: actions/download-artifact@v4
with:
name: score_sheets
path: ${{ runner.temp }}/score_sheets
name: scoresheets
path: ${{ runner.temp }}/scoresheets
- name: Preparations for GitHub Pages
if: github.ref == 'refs/heads/master'
if: github.ref_name == github.event.repository.default_branch
env:
ARTIFACTS_PATH: ${{ runner.temp }}
run: |
# Make sure directories exist
cd "$GITHUB_WORKSPACE"
cd "${GITHUB_WORKSPACE}"
mkdir -p organization
mkdir -p rulebook
mkdir -p score_sheets
FILENAME=${GITHUB_REF/refs\/heads\//}
mkdir -p scoresheets
FILENAME=${GITHUB_REF_NAME}
# Strip out any extra slashes in the rest
FILENAME=${FILENAME//\//\_}.pdf
mv $ARTIFACTS_PATH/rulebook/rulebook.pdf rulebook/$FILENAME
mv $ARTIFACTS_PATH/score_sheets/score_sheets.pdf score_sheets/$FILENAME
mv ${ARTIFACTS_PATH}/organization/organization.pdf organization/${FILENAME}
mv ${ARTIFACTS_PATH}/rulebook/rulebook.pdf rulebook/${FILENAME}
mv ${ARTIFACTS_PATH}/scoresheets/scoresheets.pdf scoresheets/${FILENAME}
- name: Commit and push to GitHub Pages
if: github.ref == 'refs/heads/master'
if: github.ref_name == github.event.repository.default_branch
uses: stefanzweifel/git-auto-commit-action@v5
with:
branch: gh-pages
commit_author: "Continuous Deployment <[email protected]>"
commit_message: "[github actions] deploy"
commit_user_name: "Continuous Deployment"
commit_user_email: "[email protected]"
file_pattern: "rulebook/* score_sheets/*"
file_pattern: "./*.pdf"
repository: ${{ github.workspace }}
skip_checkout: true
skip_fetch: true
8 changes: 6 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,12 @@ jobs:
build:
needs: [lint]
runs-on: ubuntu-latest
container: blang/latex:ubuntu
container: leplusorg/latex:latest
steps:
- uses: actions/checkout@v4
- name: LaTeX compilation Organization
run:
TERM=xterm make doorganizationonly
- name: LaTeX compilation Rulebook
run:
TERM=xterm make dorulebookonly
Expand All @@ -38,5 +41,6 @@ jobs:
generate_release_notes: false
token: ${{ secrets.GITHUB_TOKEN }}
files: |
organization.pdf
rulebook.pdf
score_sheets.pdf
scoresheets.pdf
125 changes: 103 additions & 22 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,37 @@

## MAIN ###################

OPREFIX = organization
RPREFIX = rulebook
SSREFIX = score_sheets
SSREFIX = scoresheets

## #################################### ##
## VARIABLES ##
## #################################### ##

## FILES ##################

# organization
OTEXFILE = $(OPREFIX).tex
#
ODVIFILE = $(OPREFIX).dvi
OPSFILE = $(OPREFIX).ps
OPDFFILE = $(OPREFIX).pdf
#
OAUXFILE = $(OPREFIX).aux
OIDXFILE = $(OPREFIX).idx
OADXFILE = $(OPREFIX).adx
OANDFILE = $(OPREFIX).and
OLOGFILE = $(OPREFIX).log
OBBLFILE = $(OPREFIX).bbl
OBLGFILE = $(OPREFIX).blg
#
OTARFILE = $(OPREFIX).tar
OTGZFILE = $(OPREFIX).tgz
OTBZFILE = $(OPREFIX).tbz


# rulebook
RTEXFILE = $(RPREFIX).tex
#
RDVIFILE = $(RPREFIX).dvi
Expand All @@ -41,6 +63,7 @@ RTARFILE = $(RPREFIX).tar
RTGZFILE = $(RPREFIX).tgz
RTBZFILE = $(RPREFIX).tbz

# scoresheets
SSTEXFILE = $(SSREFIX).tex
#
SSDVIFILE = $(SSREFIX).dvi
Expand Down Expand Up @@ -174,6 +197,14 @@ endif
$(SILENT) $(MAKE) mauClean
# all: mauCleanAll mauBuild mauClean

organizationonly: organization
organization:
ifndef HASRUBBER
$(SILENT) $(MAKE) doorganizationonly
else
$(SILENT) $(MAKE) ruborganizationonly
endif

rulebookonly: rulebook
rulebook:
ifndef HASRUBBER
Expand All @@ -196,18 +227,30 @@ endif

dofullpdf:
$(SILENT) $(MAKE) dopdflatex
$(SILENT) $(MAKE) domakeidx
$(SILENT) $(MAKE) doorganizationmakeidx
$(SILENT) $(MAKE) dorulebookmakeidx
$(SILENT) $(MAKE) domakeadx
$(SILENT) # $(MAKE) dobibtex
$(SILENT) # $(MAKE) doorganizationbibtex
$(SILENT) # $(MAKE) dorulebookbibtex
$(SILENT) $(MAKE) dopdflatex
$(SILENT) $(MAKE) dopdflatex

doorganizationonly:
$(SILENT) $(MENU); $(MSG) " -----------------------------------------------------------------------"; $(RESET)
$(SILENT) $(ITEM); $(MSG) " -- Creating '$(OPDFFILE)' via $(PDFLATEX)"; $(RESET)
$(SILENT) $(PDFLATEX) $(PDFLATEXFLAGS) $(OTEXFILE)
$(SILENT) $(MAKE) doorganizationmakeidx
$(SILENT) $(MAKE) doorganizationmakeidx
$(SILENT) $(PDFLATEX) $(PDFLATEXFLAGS) $(OTEXFILE)
$(SILENT) $(PDFLATEX) $(PDFLATEXFLAGS) $(OTEXFILE)
$(SILENT) $(DONE); $(MSG) " ------------------------------------------------------------- done. ---"; $(RESET)

dorulebookonly:
$(SILENT) $(MENU); $(MSG) " -----------------------------------------------------------------------"; $(RESET)
$(SILENT) $(ITEM); $(MSG) " -- Creating '$(RPDFFILE)' via $(PDFLATEX)"; $(RESET)
$(SILENT) $(PDFLATEX) $(PDFLATEXFLAGS) $(RTEXFILE)
$(SILENT) $(MAKE) domakeidx
$(SILENT) $(MAKE) domakeidx
$(SILENT) $(MAKE) dorulebookmakeidx
$(SILENT) $(MAKE) dorulebookmakeidx
$(SILENT) $(PDFLATEX) $(PDFLATEXFLAGS) $(RTEXFILE)
$(SILENT) $(PDFLATEX) $(PDFLATEXFLAGS) $(RTEXFILE)
$(SILENT) $(DONE); $(MSG) " ------------------------------------------------------------- done. ---"; $(RESET)
Expand All @@ -225,11 +268,20 @@ dopdflatex:
$(PDFLATEX) $(PDFLATEXFLAGS) -jobname='$(SSPREFIX)_DSPL' '\def\league{DSPL}\input' $(SSPREFIX)
$(PDFLATEX) $(PDFLATEXFLAGS) -jobname='$(SSPREFIX)_SSPL' '\def\league{SSPL}\input' $(SSPREFIX)
$(SILENT) $(DONE); $(MSG) " ------------------------------------------------------------- done. ---"; $(RESET)
$(SILENT) $(ITEM); $(MSG) " -- Creating '$(OPDFFILE)' via $(PDFLATEX)"; $(RESET)
$(SILENT) $(PDFLATEX) $(PDFLATEXFLAGS) $(OTEXFILE)
$(SILENT) $(DONE); $(MSG) " ------------------------------------------------------------- done. ---"; $(RESET)
$(SILENT) $(ITEM); $(MSG) " -- Creating '$(RPDFFILE)' via $(PDFLATEX)"; $(RESET)
$(SILENT) $(PDFLATEX) $(PDFLATEXFLAGS) $(RTEXFILE)
$(SILENT) $(DONE); $(MSG) " ------------------------------------------------------------- done. ---"; $(RESET)

dopdf2ps:
doorganizationpdf2ps:
$(SILENT) $(MENU); $(MSG) " -----------------------------------------------------------------------"; $(RESET)
$(SILENT) $(ITEM); $(MSG) " -- Running '$(PDF2PS)' on '$(OPDFFILE)'"; $(RESET)
$(SILENT) $(PDF2PS) $(PDF2PSFLAGS) $(OPDFFILE)
$(SILENT) $(DONE); $(MSG) " ------------------------------------------------------------- done. ---"; $(RESET)

dorulebookpdf2ps:
$(SILENT) $(MENU); $(MSG) " -----------------------------------------------------------------------"; $(RESET)
$(SILENT) $(ITEM); $(MSG) " -- Running '$(PDF2PS)' on '$(RPDFFILE)'"; $(RESET)
$(SILENT) $(PDF2PS) $(PDF2PSFLAGS) $(RPDFFILE)
Expand All @@ -239,18 +291,31 @@ dopdf2ps:
## GENERAL ##
## ##################### ##

dobibtex:
doorganizationbibtex:
$(SILENT) $(MENU); $(MSG) " -----------------------------------------------------------------------"; $(RESET)
$(SILENT) $(ITEM); $(MSG) " -- Running bibtex on '$(OPREFIX)'"; $(RESET)
$(SILENT) $(BIBTEX) $(OPREFIX)
$(SILENT) $(DONE); $(MSG) " ------------------------------------------------------------- done. ---"; $(RESET)

dorulebookbibtex:
$(SILENT) $(MENU); $(MSG) " -----------------------------------------------------------------------"; $(RESET)
$(SILENT) $(ITEM); $(MSG) " -- Running bibtex on '$(RPREFIX)'"; $(RESET)
$(SILENT) $(BIBTEX) $(RPREFIX)
$(SILENT) $(DONE); $(MSG) " ------------------------------------------------------------- done. ---"; $(RESET)

domakeidx:
doorganizationmakeidx:
$(SILENT) $(MENU); $(MSG) " -----------------------------------------------------------------------"; $(RESET)
$(SILENT) $(ITEM); $(MSG) " -- Running makeindex on '$(OIDXFILE)'"; $(RESET)
$(SILENT) $(MAKEIDX) $(OIDXFILE)
$(SILENT) $(DONE); $(MSG) " ------------------------------------------------------------- done. ---"; $(RESET)

dorulebookmakeidx:
$(SILENT) $(MENU); $(MSG) " -----------------------------------------------------------------------"; $(RESET)
$(SILENT) $(ITEM); $(MSG) " -- Running makeindex on '$(RIDXFILE)'"; $(RESET)
$(SILENT) $(MAKEIDX) $(RIDXFILE)
$(SILENT) $(DONE); $(MSG) " ------------------------------------------------------------- done. ---"; $(RESET)

# Indepent of organization/rulebook
domakeadx:
$(SILENT) $(MENU); $(MSG) " -----------------------------------------------------------------------"; $(RESET)
$(SILENT) $(ITEM); $(MSG) " -- Running makeindex on '$(ADXFILE)' (abbreviations)"; $(RESET)
Expand All @@ -261,10 +326,18 @@ domakeadx:
## WARNINGS ##
## ##################### ##

#wall: warntex warn2do
wall: warn2do warnspell summary
#wall: organizationwarntex rulebookwarntex warn2do
wall: warn2do warnspell organizationsummary rulebooksummary

warntex:
organizationwarntex:
$(SILENT) $(MENU); $(MSG) " -----------------------------------------------------------------------"; $(RESET)
$(SILENT) $(ITEM); $(MSG) " -- grep LaTeX/pdfTeX Warnings in '$(OTEXFILE)' ..."; $(RESET)
$(SILENT) $(LATEX) $(OTEXFILE) | grep -i -A 1 "tex warning" \
&& ($(ERROR); $(MSG) " -> please take care of the above TeX-warnings\n"; $(RESET)) \
|| ($(CHECK); $(MSG) " =) TeX generated NO warnings"; $(RESET))
$(SILENT) $(DONE); $(MSG) " ------------------------------------------------------------- done. ---"; $(RESET)

rulebookwarntex:
$(SILENT) $(MENU); $(MSG) " -----------------------------------------------------------------------"; $(RESET)
$(SILENT) $(ITEM); $(MSG) " -- grep LaTeX/pdfTeX Warnings in '$(RTEXFILE)' ..."; $(RESET)
$(SILENT) $(LATEX) $(RTEXFILE) | grep -i -A 1 "tex warning" \
Expand Down Expand Up @@ -306,35 +379,39 @@ warnspell:
$(SILENT) $(MENU); $(MSG) " -----------------------------------------------------------------------"; $(RESET)
$(SILENT) for TEXFILE in *.tex ; \
do \
if [ $$TEXFILE != "$(RTEXFILE)" ] && [ $$TEXFILE != "macros.tex" ] && [ $$TEXFILE != "abbrevix.tex" ] && [ $$TEXFILE != "dummybox.tex" ]; then \
#if [ $$TEXFILE != "$(RTEXFILE)" ] && [ $$TEXFILE != "macros.tex" ] && [ $$TEXFILE != "abbrevix.tex" ] && [ $$TEXFILE != "dummybox.tex" ]; then \
if [ $$TEXFILE != "macros.tex" ] && [ $$TEXFILE != "abbrevix.tex" ] && [ $$TEXFILE != "dummybox.tex" ]; then \
$(ITEM); $(MSG) " -- spell check result on '$$TEXFILE'"; $(RESET) ; \
$(SPELL) $(SPELL_OPT) $(SPELL_ADDITIONAL_OPT) $(SPELL_WARN) $$TEXFILE ; \
fi ; \
done
$(SILENT) for TEXFILE in scoresheets/*.tex ; \
do \
if [ $$TEXFILE != "$(RTEXFILE)" ] && [ $$TEXFILE != "macros.tex" ] && [ $$TEXFILE != "abbrevix.tex" ] && [ $$TEXFILE != "dummybox.tex" ]; then \
$(ITEM); $(MSG) " -- spell check result on '$$TEXFILE'"; $(RESET) ; \
$(SPELL) $(SPELL_OPT) $(SPELL_ADDITIONAL_OPT) $(SPELL_WARN) $$TEXFILE ; \
fi ; \
$(ITEM); $(MSG) " -- spell check result on '$$TEXFILE'"; $(RESET) ; \
$(SPELL) $(SPELL_OPT) $(SPELL_ADDITIONAL_OPT) $(SPELL_WARN) $$TEXFILE ; \
done
$(SILENT) for TEXFILE in tasks/*.tex ; \
do \
if [ $$TEXFILE != "$(RTEXFILE)" ] && [ $$TEXFILE != "macros.tex" ] && [ $$TEXFILE != "abbrevix.tex" ] && [ $$TEXFILE != "dummybox.tex" ]; then \
$(ITEM); $(MSG) " -- spell check result on '$$TEXFILE'"; $(RESET) ; \
$(SPELL) $(SPELL_OPT) $(SPELL_ADDITIONAL_OPT) $(SPELL_WARN) $$TEXFILE ; \
fi ; \
$(ITEM); $(MSG) " -- spell check result on '$$TEXFILE'"; $(RESET) ; \
$(SPELL) $(SPELL_OPT) $(SPELL_ADDITIONAL_OPT) $(SPELL_WARN) $$TEXFILE ; \
done
# ToDo: remove this and the tests folder
#$(SILENT) for TEXFILE in tests/*.tex ; \
#do \
# $(ITEM); $(MSG) " -- spell check result on '$$TEXFILE'"; $(RESET) ; \
# $(SPELL) $(SPELL_OPT) $(SPELL_ADDITIONAL_OPT) $(SPELL_WARN) $$TEXFILE ; \
#done
#$(SILENT) $(DONE); $(MSG) " ------------------------------------------------------------- done. ---"; $(RESET)

summary:
organizationsummary:
$(SILENT) $(MENU); $(MSG) " -----------------------------------------------------------------------"; $(RESET)
$(SILENT) $(ITEM); $(MSG) " -- SUMMARY"; $(RESET)
$(SILENT) $(ITEM); $(MSG) " -- ORGANIZATION SUMMARY"; $(RESET)
$(SILENT) tail -n1 $(OPREFIX).log
$(SILENT) $(DONE); $(MSG) " -----------------------------------------------------------------------"; $(RESET)

rulebooksummary:
$(SILENT) $(MENU); $(MSG) " -----------------------------------------------------------------------"; $(RESET)
$(SILENT) $(ITEM); $(MSG) " -- RULEBOOK SUMMARY"; $(RESET)
$(SILENT) tail -n1 $(RPREFIX).log
$(SILENT) $(DONE); $(MSG) " -----------------------------------------------------------------------"; $(RESET)

Expand All @@ -360,13 +437,17 @@ clean:

dirk: mauBuild
mauBuild:
$(SILENT) $(RUBBER) $(RUBBERFLAGS) $(OTEXFILE)
$(SILENT) $(RUBBER) $(RUBBERFLAGS) $(RTEXFILE)
$(SILENT) for league in OPL DSPL SSPL ; do \
(echo "\def\league{$$league}" ; cat $(SSTEXFILE) ) > "$(SSPREFIX)_$$league.tex" ; \
$(RUBBER) $(RUBBERFLAGS) $ "$(SSPREFIX)_$$league.tex" ; \
rm -f "$(SSPREFIX)_$$league.tex" "$(SSPREFIX)_$$league.out" "$(SSPREFIX)_$$league.log" "$(SSPREFIX)_$$league.aux"; \
done

ruboganizationonly:
$(SILENT) $(RUBBER) $(RUBBERFLAGS) $(OTEXFILE)

rubrulebookonly:
$(SILENT) $(RUBBER) $(RUBBERFLAGS) $(RTEXFILE)

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ RoboCup@Home teams and team members are welcome to post GitHub issues for clarif

Improvements are also welcome in the form of pull requests (see [guidelines](https://github.com/RoboCupAtHome/RuleBook/wiki/Guidelines)).

[Score sheets](http://latex.aslushnikov.com/compile?git=git://github.com/RoboCupAtHome/RuleBook.git&target=score_sheets.tex)
[Score sheets](https://robocupathome.github.io/RuleBook/scoresheets/master.pdf))

### FAQ
See the Frequently Asked Questions [here](https://github.com/RoboCupAtHome/RuleBook/wiki/FAQ:-Frequently-Asked-Questions).
Expand Down
Loading

0 comments on commit 8d201f6

Please sign in to comment.