Skip to content

fix: typo in workflow #64

fix: typo in workflow

fix: typo in workflow #64

Workflow file for this run

name: Main
on:
push:
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
build-english:
runs-on: ubuntu-22.04
steps:
- name: Set up Git repository
uses: actions/checkout@v2
- name: Setup Python3
uses: actions/setup-python@v2
with:
python-version: 3.12.1
- name: Install pip dependencies
run: |
python -m pip install -r requirements.txt
- name: Create build and output folder
working-directory: ./english
run: |
mkdir -p build output
- name: Upload data as artifact
uses: actions/upload-artifact@v4
with:
name: english-data
path: english/data
- name: Create format files with Python
working-directory: ./english
run: |
python format.py oxford_3000
python format.py oxford_5000
python format.py oxford_5000_exclusive
- name: Upload html as artifact
uses: actions/upload-artifact@v4
with:
name: english-output-html
path: english/output/*.html
- name: Install wkthtmltopdf
run: |
sudo apt-get update && sudo apt-get install -y wkhtmltopdf
- name: Convert html to pdf with wkhtmltopdf
working-directory: ./english
run: |
wkhtmltopdf --user-style-sheet format/table.css output/oxford_3000_alphabetical.html output/oxford_3000_alphabetical.pdf
wkhtmltopdf --user-style-sheet format/table.css output/oxford_3000_by_cefr_shuffle.html output/oxford_3000_by_cefr_shuffle.pdf
wkhtmltopdf --user-style-sheet format/table.css output/oxford_3000_underscore_alphabetical.html output/oxford_3000_underscore_alphabetical.pdf
wkhtmltopdf --user-style-sheet format/table.css output/oxford_3000_underscore_by_cefr.html output/oxford_3000_underscore_by_cefr.pdf
wkhtmltopdf --user-style-sheet format/table.css output/oxford_3000_by_cefr.html output/oxford_3000_by_cefr.pdf
wkhtmltopdf --user-style-sheet format/table.css output/oxford_5000_alphabetical.html output/oxford_5000_alphabetical.pdf
wkhtmltopdf --user-style-sheet format/table.css output/oxford_5000_by_cefr.html output/oxford_5000_by_cefr.pdf
wkhtmltopdf --user-style-sheet format/table.css output/oxford_5000_by_cefr_shuffle.html output/oxford_5000_by_cefr_shuffle.pdf
wkhtmltopdf --user-style-sheet format/table.css output/oxford_5000_underscore_alphabetical.html output/oxford_5000_underscore_alphabetical.pdf
wkhtmltopdf --user-style-sheet format/table.css output/oxford_5000_underscore_by_cefr.html output/oxford_5000_underscore_by_cefr.pdf
wkhtmltopdf --user-style-sheet format/table.css output/oxford_5000_exclusive_alphabetical.html output/oxford_5000_exclusive_alphabetical.pdf
wkhtmltopdf --user-style-sheet format/table.css output/oxford_5000_exclusive_by_cefr.html output/oxford_5000_exclusive_by_cefr.pdf
wkhtmltopdf --user-style-sheet format/table.css output/oxford_5000_exclusive_by_cefr_shuffle.html output/oxford_5000_exclusive_by_cefr_shuffle.pdf
wkhtmltopdf --user-style-sheet format/table.css output/oxford_5000_exclusive_underscore_alphabetical.html output/oxford_5000_exclusive_underscore_alphabetical.pdf
wkhtmltopdf --user-style-sheet format/table.css output/oxford_5000_exclusive_underscore_by_cefr.html output/oxford_5000_exclusive_underscore_by_cefr.pdf
- name: Upload html-to-pdf as artifact
uses: actions/upload-artifact@v4
with:
name: english-output-pdf-from-html
path: english/output/*.pdf
- name: Create pdf with Latex
uses: xu-cheng/latex-action@v3
with:
working_directory: english/format
latexmk_use_xelatex: true
root_file: |
*.tex
- name: Upload tex-to-pdf as artifact
uses: actions/upload-artifact@v4
with:
name: english-output-pdf-from-tex
path: english/format/*.pdf
build-spanish:
runs-on: ubuntu-22.04
steps:
- name: Set up Git repository
uses: actions/checkout@v2
- name: Setup Python3
uses: actions/setup-python@v2
with:
python-version: 3.12.1
- name: Install pip dependencies
run: |
python -m pip install -r requirements.txt
- name: Create build and output folder
working-directory: ./spanish
run: |
mkdir -p build output
- name: Upload data as artifact
uses: actions/upload-artifact@v4
with:
name: spanish-data
path: spanish/data
- name: Create format files with Python
working-directory: ./spanish
run: |
python format.py spanish_3000
python format.py spanish_5000
- name: Upload html as artifact
uses: actions/upload-artifact@v4
with:
name: spanish-output-html
path: spanish/output/*.html
- name: Install wkthtmltopdf
run: |
sudo apt-get update && sudo apt-get install -y wkhtmltopdf
- name: Convert html to pdf with wkhtmltopdf
working-directory: ./spanish
run: |
wkhtmltopdf --user-style-sheet format/table.css output/spanish_3000_alphabetical.html output/spanish_3000_alphabetical.pdf
wkhtmltopdf --user-style-sheet format/table.css output/spanish_3000_shuffled.html output/spanish_3000_shuffled.pdf
wkhtmltopdf --user-style-sheet format/table.css output/spanish_3000_underscore_alphabetical.html output/spanish_3000_underscore_alphabetical.pdf
wkhtmltopdf --user-style-sheet format/table.css output/spanish_3000_underscore_by_cefr_alphabetical.html output/spanish_3000_underscore_by_cefr_alphabetical.pdf
wkhtmltopdf --user-style-sheet format/table.css output/spanish_3000_underscore_by_cefr_shuffled.html output/spanish_3000_underscore_by_cefr_shuffled.pdf
wkhtmltopdf --user-style-sheet format/table.css output/spanish_3000_underscore_shuffled.html output/spanish_3000_underscore_shuffled.pdf
wkhtmltopdf --user-style-sheet format/table.css output/spanish_5000_alphabetical.html output/spanish_5000_alphabetical.pdf
wkhtmltopdf --user-style-sheet format/table.css output/spanish_5000_shuffled.html output/spanish_5000_shuffled.pdf
wkhtmltopdf --user-style-sheet format/table.css output/spanish_5000_underscore_alphabetical.html output/spanish_5000_underscore_alphabetical.pdf
wkhtmltopdf --user-style-sheet format/table.css output/spanish_5000_underscore_by_cefr_alphabetical.html output/spanish_5000_underscore_by_cefr_alphabetical.pdf
wkhtmltopdf --user-style-sheet format/table.css output/spanish_5000_underscore_by_cefr_shuffled.html output/spanish_5000_underscore_by_cefr_shuffled.pdf
wkhtmltopdf --user-style-sheet format/table.css output/spanish_5000_underscore_shuffled.html output/spanish_5000_underscore_shuffled.pdf
- name: Upload html-to-pdf as artifact
uses: actions/upload-artifact@v4
with:
name: spanish-output-pdf-from-html
path: spanish/output/*.pdf
- name: Create pdf with Latex
uses: xu-cheng/latex-action@v3
with:
working_directory: spanish/format
latexmk_use_xelatex: true
root_file: |
*.tex
- name: Upload tex-to-pdf as artifact
uses: actions/upload-artifact@v4
with:
name: spanish-output-pdf-from-tex
path: spanish/format/*.pdf
deploy:
needs: [build-english, build-spanish]
runs-on: ubuntu-22.04
if: startsWith(github.ref, 'refs/tags/v')
#git tag -a v1.0.0 -m "initial release"
#git push --follow-tags
steps:
- name: Setup folder structure
run: |
mkdir -p english/data english/output
mkdir -p spanish/data spanish/output
- name: Retrieve data artifact
uses: actions/download-artifact@v4
with:
name: english-data
path: english/data
- name: Retrieve data artifact
uses: actions/download-artifact@v4
with:
name: spanish-data
path: spanish/data
- name: Display structure of data files
run: |
ls -R english/data
- name: Display structure of data files
run: |
ls -R spanish/data
- name: Retrieve formatted artifacts
uses: actions/download-artifact@v4
with:
pattern: english-output-*
merge-multiple: true
path: english/output
- name: Display structure of output files
run: ls -R english/output
- name: zip english-data
uses: montudor/action-zip@v1
with:
args: zip -qq -r english-data.zip . -i english/data/*
- name: zip english-output
uses: montudor/action-zip@v1
with:
args: zip -qq -r english-output.zip . -i english/output/*
- name: Retrieve formatted artifacts
uses: actions/download-artifact@v4
with:
pattern: spanish-output-*
merge-multiple: true
path: spanish/output
- name: Display structure of output files
run: ls -R spanish/output
- name: zip spanish-data
uses: montudor/action-zip@v1
with:
args: zip -qq -r spanish-data.zip . -i spanish/data/*
- name: zip spanish-output
uses: montudor/action-zip@v1
with:
args: zip -qq -r spanish-output.zip . -i spanish/output/*
- name: Release
uses: softprops/action-gh-release@v1
with:
body: |
English:
- extracted data/ in `.pkl`, `.csv`, `.json` format
- formatted/styled output/ in `.pdf` and `.html` format.
Spanish:
- extracted data/ in `.pkl` format
- formatted/style output/ in `.pdf` and `.html` format
files: |
english-data.zip
english-output.zip
spanish-data.zip
spanish-output.zip