-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (31 loc) · 1.14 KB
/
on-release.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
name: Convert ODT to PDF and attach to release
on:
release:
types: [created]
jobs:
convert_and_upload:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Download and install Ubuntu font
run: |
sudo apt-get install -y fontconfig
wget https://assets.ubuntu.com/v1/0cef8205-ubuntu-font-family-0.83.zip
unzip 0cef8205-ubuntu-font-family-0.83.zip -d ubuntu-font
sudo mkdir -p /usr/share/fonts/truetype/ubuntu
sudo cp ubuntu-font/ubuntu-font-family-0.83/*.ttf /usr/share/fonts/truetype/ubuntu/
sudo fc-cache -fv
shell: bash
- name: Install LibreOffice
run: sudo apt-get update && sudo apt-get install -y libreoffice
- name: Convert ODT to PDF
run: find . -name "*.odt" -exec libreoffice --headless --convert-to pdf {} \;
- name: List and upload PDFs
run: |
for pdf in $(find . -name "*.pdf"); do
echo "Uploading $pdf"
gh release upload ${{ github.event.release.tag_name }} "$pdf" --repo $GITHUB_REPOSITORY
done
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}