Convert ODT to PDF and attach to release #6
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |