forked from mikepqr/resume.md
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This major update changes how PDFs are built. Instead of requiring weasyprint we use Google Chrome (or Chromium). Weasyprint turns out to be non-trivial to install (especially on Windows and Apple Silicon). This change is made by adding functionality to launch Chrome in headless mode to resume.py. This requires lots of special cases and options to get things to work on all the platforms I've tested. resume.py is now a "real" command line program with --no-html, --no-pdf, --quiet and --chrome-path options. The script uses Chromium if it is available, falling back to the evil version if Chromium is not found. It searches likely paths for the Chromium/Chrome executable, but you can specify the path with the --chrome-path option. This commit also adds a GitHub action to build HTML and PDF on Linux, Windows and macOS. Inspection of the build artifacts is useful for testing. It is related to mikepqr#1, but is probably not ready for use by regular users. Closes mikepqr#4, mikepqr#6, mikepqr#8
- Loading branch information
Showing
6 changed files
with
343 additions
and
71 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: build | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
push: | ||
branches: | ||
main | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
steps: | ||
- name: Check out repo | ||
uses: actions/checkout@v2 | ||
- name: Install markdown | ||
run: pip3 install markdown | ||
- name: Make resume | ||
run: python3 resume.py | ||
- name: Rename output | ||
if: ${{ matrix.os != 'windows-latest' }} | ||
run: | | ||
mv resume.pdf resume_$RUNNER_OS.pdf | ||
mv resume.html resume_$RUNNER_OS.html | ||
- name: Rename output (Windows) | ||
if: ${{ matrix.os == 'windows-latest' }} | ||
run: | | ||
mv resume.pdf resume_windows.pdf | ||
mv resume.html resume_windows.html | ||
- name: Archive resume.html and resume.pdf | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
path: | | ||
*.html |
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
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
Binary file not shown.
Oops, something went wrong.