Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull first version of entry rules into main branch #7

Merged
merged 14 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .ci/adoc-to-tex.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ mkdir -p tmp rules_documents
set -euo pipefail

OUTPUT_FILE=$1
cp $1.adoc tmp/$1.adoc

cp $OUTPUT_FILE/rules.adoc tmp/$OUTPUT_FILE.adoc

cd tmp

Expand Down
2 changes: 1 addition & 1 deletion .ci/tex-to-pdf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ dblatex -T db2latex $OUTPUT_FILE.xml -t tex --texstyle=./manual.sty -p ../custom
# (marked by the \mainmatter command) and create a file without it.
cat $OUTPUT_FILE.tex | awk 'f;/\\mainmatter/{f=1}' > $OUTPUT_FILE"_without_preamble.tex"
# Concat the standardized preamble with the "without_preamble" version of the file
cat ../preamble.tex $OUTPUT_FILE"_without_preamble.tex" > $OUTPUT_FILE.tex
cat "../preamble.tex" "../"$OUTPUT_FILE"/header_footer.tex" "../"$OUTPUT_FILE"/title.tex" "../committee_list.tex" $OUTPUT_FILE"_without_preamble.tex" > $OUTPUT_FILE.tex
texliveonfly $OUTPUT_FILE.tex
pdflatex $OUTPUT_FILE.tex
pdflatex $OUTPUT_FILE.tex
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/build_entry_rules.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
on:
push:
paths:
- 'onstage_entry_rules/rules.adoc'
- 'onstage_entry_rules/header_footer.tex'
- 'onstage_entry_rules/title.tex'
- 'preamble.tex'

jobs:
build:
name: build entry rules
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2

- name: build entry rules
run: |
docker run -v $(pwd):/documents asciidoctor/docker-asciidoctor .ci/adoc-to-tex.sh onstage_entry_rules
docker run -v $(pwd):/documents mrshu/texlive-dblatex .ci/tex-to-pdf.sh onstage_entry_rules
mkdir -p dist/${GITHUB_REF#refs/heads/}/
cp -R ./media rules_documents/* dist/${GITHUB_REF#refs/heads/}/

- name: publish entry rules
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
keep_files: True
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
on: [push]
on:
push:
paths:
- 'onstage_rules/rules.adoc'
- 'onstage_rules/header_footer.tex'
- 'onstage_rules/title.tex'
- 'preamble.tex'


jobs:
build:
name: build
name: build main rules
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2

- name: build the rules
- name: build main rules
run: |
docker run -v $(pwd):/documents asciidoctor/docker-asciidoctor .ci/adoc-to-tex.sh onstage_rules
docker run -v $(pwd):/documents mrshu/texlive-dblatex .ci/tex-to-pdf.sh onstage_rules
mkdir -p dist/${GITHUB_REF#refs/heads/}/
cp -R ./media rules_documents/* dist/${GITHUB_REF#refs/heads/}/

- name: publish the rules
- name: publish main rules
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
88 changes: 75 additions & 13 deletions build_rules_on_windows.bat
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@echo off
setlocal enabledelayedexpansion

REM Set the path to the Git repository dynamically
set REPO_PATH=%CD%
Expand All @@ -9,22 +10,77 @@ set REPO_PATH=%REPO_PATH:\=/%
REM Replace C: with /mnt/c/
set REPO_PATH=%REPO_PATH:C:=/mnt/c%

echo Running commands in WSL...
wsl which dos2unix > NUL 2>&1
if %ERRORLEVEL% NEQ 0 (
goto installdos2unix
) else (
goto selectrules
)

echo dos2unix is required to build the rules. Do you want to check if dos2unix is installed and install if necessary?
set /p performCheck=Type 'y' for yes otherwise press ENTER:
:installdos2unix
echo dos2unix is required to build the rules. Do you want to install it?
set /p performInstallationNew=Type 'y' for yes:
if "%performInstallationNew%"=="y" (
echo Installing dos2unix...
wsl sudo apt-get update
wsl sudo apt-get install dos2unix
echo.
echo.
goto checkinstallation
) else (
echo.
echo.
echo Skipped dos2unix installation. Can not build rules.
goto :end
)

if /i "%performCheck%"=="y" (
wsl /usr/bin/dos2unix --version > /dev/null 2>&1
if %ERRORLEVEL% NEQ 0 (
echo Installing dos2unix...
wsl sudo apt-get update
wsl sudo apt-get install dos2unix
:checkinstallation
wsl which dos2unix > NUL 2>&1
if %ERRORLEVEL% NEQ 0 (
echo Installation failed. Can not build the rules.
goto end
) else goto selectrules

:selectrules
echo Available rule folders:
set "folderIndex=1"
rem Initialize an array to store folder names
setlocal enabledelayedexpansion
set "folderArray="
for /d %%i in (*) do (
set "folderName=%%i"
rem Skip folders starting with a dot or named "icons", "media", or "rules_documents"
if "!folderName:~0,1!" neq "." (
if /i "!folderName!" neq "icons" (
if /i "!folderName!" neq "media" (
if /i "!folderName!" neq "rules_documents" (
echo [!folderIndex!] %%i
rem Store folder name in array with corresponding index
set "folderArray[!folderIndex!]=%%i"
set /a "folderIndex+=1"
)
)
)
)
)

echo.
set /p selection=Enter the number corresponding to the folder you want to select:

rem Get the selected folder name based on user input
set "selectedFolder="
if defined folderArray[%selection%] (
set "selectedFolder=!folderArray[%selection%]!"
) else (
echo Skipped dos2unix check and installation.
echo Invalid selection.
pause
goto :eof
)

echo.
echo You selected: %selectedFolder%
echo.
echo.

REM Create temporary copies of .sh scripts with Linux-style line endings using wsl cp (because Github checkout might automatically change them to Windows style which will stop the scripts from working)
wsl cp %REPO_PATH%/.ci/adoc-to-tex.sh %REPO_PATH%/.ci/adoc-to-tex-temp.sh
Expand All @@ -36,14 +92,20 @@ wsl dos2unix %REPO_PATH%/.ci/tex-to-pdf-temp.sh

REM Run commands in WSL with sudo for Docker
@echo Building rules
wsl sudo docker run -v %REPO_PATH%:/documents asciidoctor/docker-asciidoctor .ci/adoc-to-tex-temp.sh onstage_rules
wsl sudo docker run -v %REPO_PATH%:/documents mrshu/texlive-dblatex .ci/tex-to-pdf-temp.sh onstage_rules
wsl sudo docker run -v %REPO_PATH%:/documents asciidoctor/docker-asciidoctor .ci/adoc-to-tex-temp.sh %selectedFolder%
wsl sudo docker run -v %REPO_PATH%:/documents mrshu/texlive-dblatex .ci/tex-to-pdf-temp.sh %selectedFolder%

REM Clean up temporary files
wsl rm %REPO_PATH%/.ci/adoc-to-tex-temp.sh
wsl rm %REPO_PATH%/.ci/tex-to-pdf-temp.sh

echo WSL commands completed.
echo.
echo.
echo.
echo.

:end
REM Pause the script and wait for any key to be pressed
pause

endlocal
25 changes: 25 additions & 0 deletions committee_list.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
\begin{tabular}{rl}
\resizebox{0.50\textwidth}{!}{
\begin{tabular}{lr}
\multicolumn{2}{l}{\textbf{OnStage League Committee 2024:}}\\
Christian Häußler & Germany (CHAIR)\\
Nicky Hughes & UK\\
Mauricio Gutierrez & Mexico\\
Amy Eguchi & USA\\
Thundluck Sereevoravitgul & Thailand\\
\end{tabular}}
&
\resizebox{0.50\textwidth}{!}{
\begin{tabular}{lr}
\multicolumn{2}{l}{\textbf{OnStage League Committee 2023:}}\\
Christian Häußler & Germany (CHAIR)\\
Nicky Hughes & UK\\
Nicolas Doyon & Canada\\
Amy Eguchi & USA\\
Thundluck Sereevoravitgul & Thailand\\
Koto Sakamoto & Japan\\
\end{tabular}}

\end{tabular}

\vspace{20pt}
18 changes: 18 additions & 0 deletions onstage_entry_rules/header_footer.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
\lhead{}
\chead{}
\rhead{\includegraphics[width=8cm]{media/robocup_header.png}}
\renewcommand{\headrulewidth}{0pt}
%\renewcommand{\topmargin}{-20pt}

\rfoot{Page \textbf{\thepage} of \textbf{\pageref{LastPage}}}
\lfoot{\textit{DRAFT rules as of \today}}
\cfoot{}

% First page
\fancypagestyle{firststyle}{%
\fancyhf{}
\fancyfoot[L]{\textit{DRAFT rules as of \today}}
\fancyfoot[R]{Page \textbf{\thepage} of \textbf{\pageref{LastPage}}}
}

\vspace{20pt}
Loading
Loading