-
-
Notifications
You must be signed in to change notification settings - Fork 682
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add executable generation for Linux and macOS
- Loading branch information
Showing
1 changed file
with
43 additions
and
0 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,43 @@ | ||
name: WeasyPrint’s exe generation | ||
on: [push] | ||
|
||
jobs: | ||
generate: | ||
name: ${{ matrix.os }} - ${{ matrix.python-version }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: ['ubuntu-20.04', 'macos-11'] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' | ||
- name: Use absolute imports | ||
run: | | ||
sed --in-place='' "s/from \. /from weasyprint /" weasyprint/__main__.py | ||
sed --in-place='' "s/from \./from weasyprint\./" weasyprint/__main__.py | ||
- name: Install Pango (MacOS) | ||
if: matrix.os == 'macos-latest' | ||
run: | | ||
rm /usr/local/bin/2to3 | ||
brew install pango | ||
- name: Install Pango (Windows) | ||
if: matrix.os == 'windows-latest' | ||
run: | | ||
C:\msys64\usr\bin\bash -lc 'pacman -S mingw-w64-x86_64-pango --noconfirm' | ||
rm C:\msys64\mingw64\bin\python.exe | ||
- name: Install requirements | ||
run: python -m pip install . pyinstaller | ||
- name: Generate executable | ||
run: python -m PyInstaller weasyprint/__main__.py -n weasyprint -F | ||
- name: Test executable | ||
run: dist/weasyprint --help | ||
- name: Store executable | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: weasyprint | ||
path: | | ||
dist/weasyprint | ||
README.rst | ||
LICENSE |