This repository has been archived by the owner on Mar 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (75 loc) · 2.38 KB
/
generate.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Automated CSV Generation
on:
push:
pull_request:
schedule:
- cron: '5 22 * * *'
workflow_dispatch:
jobs:
generate-csv:
name: Generate CSVs
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- file: de_dilbert
encoding: windows-1258
- file: dilbert
encoding: ISO8859-15
- file: drabble
encoding: ISO8859-15
- file: garfield
encoding: windows-1250
- file: Tom
encoding: UTF-8
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.x'
- run: wget http://john.ccac.rwth-aachen.de:8000/ftp/dilbert/${{ matrix.file }}.txt
working-directory: ${{ runner.temp }}
- run: iconv -f ${{ matrix.encoding }} -t UTF-8 ${{ runner.temp }}/${{ matrix.file }}.txt > ${{ matrix.file }}.txt
- uses: actions/upload-artifact@v3
with:
path: ${{ matrix.file }}.txt
name: original
- run: python setup.py install
- run: python -m garfieldcsv ${{ matrix.file }}.txt ${{ matrix.file }}.csv
- continue-on-error: true
run: python -m garfieldcsv.sanitizer ${{ matrix.file }}.csv
- uses: actions/upload-artifact@v3
with:
path: ${{ matrix.file }}.csv
name: ${{ matrix.file }}
- run: |
sha256sum ${{ matrix.file }}.txt ${{ matrix.file }}.csv > ${{ matrix.file }}.sha256
- uses: actions/upload-artifact@v3
with:
path: ${{ matrix.file }}.sha256
name: hashes
deploy-gh-pages:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
# only run on that branch
if: github.ref == 'refs/heads/main'
needs: [generate-csv]
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
path: static
- working-directory: static
run: |
mv original/* .
mv hashes/* .
mv */*.csv .
- uses: docker://pandoc/core:2.9
with:
args: "README.md -f markdown -t html --shift-heading-level-by=-1 -s -o static/index.html"
- uses: JamesIves/github-pages-deploy-action@v4
with:
folder: static
git-config-name: github-actions[bot]
git-config-email: 41898282+github-actions[bot]@users.noreply.github.com