Skip to content

Add data to artifact and fix duplicate artifact name #11

Add data to artifact and fix duplicate artifact name

Add data to artifact and fix duplicate artifact name #11

Workflow file for this run

name: Main
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
build:
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.8
- 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_english.py oxford_3000
python format_english.py oxford_5000
python format_english.py oxford_5000_exclusive
- name: Upload html as artifact
uses: actions/upload-artifact@v4
with:
name: english-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-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-pdf-from-tex
path: english/format/*.pdf
- name: Move pdfs from format/ to /output/
if: startsWith(github.ref, 'refs/tags/')
run: |
mv english/format/*pdf english/output
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
body: |
in this Release
- extracted data found in `.pkl`, `.csv`, `.json` format
- formatted/styled data in `.pdf` and `.html` format.
files: |
english/output/*
english/data/*