Release #106
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: Release | |
on: | |
workflow_dispatch: | |
inputs: | |
draft: | |
description: 'Draft' | |
type: boolean | |
required: true | |
pypi: | |
description: 'Deploy to PyPi' | |
type: boolean | |
required: true | |
win: | |
description: 'Build for Windows' | |
type: boolean | |
required: true | |
mac: | |
description: 'build for macOS' | |
type: boolean | |
required: true | |
jobs: | |
pypi-release: | |
if: ${{ inputs.pypi }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.8 # old to support Windows 7 | |
- name: Update package index | |
run: sudo apt-get update | |
- name: Install wxPython dependencies | |
# list of packages from https://github.com/wxWidgets/Phoenix/ | |
run: | | |
sudo apt install \ | |
dpkg-dev \ | |
build-essential \ | |
python3-dev \ | |
freeglut3-dev \ | |
libgl1-mesa-dev \ | |
libglu1-mesa-dev \ | |
libunwind-dev \ | |
libgstreamer-plugins-base1.0-dev \ | |
libgtk-3-dev \ | |
libjpeg-dev \ | |
libnotify-dev \ | |
libpng-dev \ | |
libsdl2-dev \ | |
libsm-dev \ | |
libtiff-dev \ | |
libwebkit2gtk-4.0-dev \ | |
libxtst-dev | |
- name: Compile translation files and build distribution | |
run: | | |
python3 pdfstitcher/update_loc.py --compile | |
pip3 install build | |
python3 -m build | |
- name: Publish to pypi | |
uses: pypa/[email protected] | |
with: | |
password: ${{ secrets.PYPI_TOKEN }} | |
win-build: | |
if: ${{ inputs.win }} | |
runs-on: windows-2019 | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.8" # needs to be 3.8 to support Windows 7 | |
- name: Install dependencies | |
run: | | |
pip install .[gui] | |
python pdfstitcher/update_loc.py --compile | |
echo "VERSION_STRING=v$(grep 'version' pyproject.toml | awk '{print $3}' | sed 's/\"//g')" >> $GITHUB_ENV | |
- uses: Nuitka/Nuitka-Action@main | |
with: | |
nuitka-version: main | |
script-name: pdfstitcher/gui/app.py | |
onefile: true | |
include-data-dir: | | |
pdfstitcher/resources=pdfstitcher/resources | |
pdfstitcher/locale=pdfstitcher/locale | |
include-package-data: pdf_mangler | |
output-file: pdfstitcher.exe | |
windows-console-mode: disable | |
windows-icon-from-ico: pdfstitcher/resources/stitcher-icon.ico | |
- name: GH Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: build/pdfstitcher.exe | |
draft: ${{ inputs.draft }} | |
tag_name: ${{ env.VERSION_STRING }} | |
mac-build: | |
if: ${{ inputs.mac }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [macos-11, macos-latest] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Puthon | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
architecture: ${{ runner.arch }} | |
cache: 'pip' | |
- name: Install dependencies and compile translation files | |
run: | | |
brew install qpdf | |
pip install ".[gui]" | |
python pdfstitcher/update_loc.py --compile | |
echo "VERSION_STRING=v$(grep 'version' pyproject.toml | awk '{print $3}' | sed 's/\"//g')" >> $GITHUB_ENV | |
- name: Fix Python path for Intel | |
# From https://github.com/Nuitka/Nuitka/issues/2580 | |
if: ${{ runner.arch == 'X64' }} | |
run: | | |
export PYTHONPATH=/usr/local/opt/qpdf/lib/:$PYTHONPATH | |
- name: Configure code signing | |
uses: apple-actions/import-codesign-certs@v3 | |
with: | |
p12-file-base64: ${{ secrets.APPLE_SIGN_CERTIFICATE }} | |
p12-password: ${{ secrets.APPLE_SIGN_PASSWORD }} | |
- name: Build with Nuitka | |
uses: Nuitka/Nuitka-Action@main | |
with: | |
nuitka-version: main | |
script-name: pdfstitcher/gui/app.py | |
standalone: true | |
onefile: false | |
macos-create-app-bundle: true | |
macos-app-icon: pdfstitcher/resources/stitcher-icon.icns | |
include-data-dir: | | |
pdfstitcher/resources=pdfstitcher/resources | |
pdfstitcher/locale=pdfstitcher/locale | |
include-package-data: pdf_mangler | |
company-name: "Charlotte Curtis" | |
product-name: "PDF Stitcher" | |
macos-app-name: "PDF Stitcher" | |
macos-app-version: ${{ env.VERSION_STRING }} | |
macos-signed-app-name: "com.charlottecurtis.pdfstitcher" | |
macos-sign-identity: ${{ secrets.APPLE_SIGN_IDENTITY}} | |
- name: Rename app | |
run: mv build/app.app build/pdfstitcher.app | |
- name: Create dmg | |
run: | | |
brew install create-dmg | |
create-dmg \ | |
--volname "PDFStitcher Installer" \ | |
--background "pdfstitcher/resources/install_background.png" \ | |
--window-pos 200 120 \ | |
--window-size 800 400 \ | |
--icon-size 100 \ | |
--icon "pdfstitcher.app" 145 185 \ | |
--no-internet-enable \ | |
--app-drop-link 595 185 \ | |
"build/PDFStitcher-Installer.dmg" \ | |
"build/pdfstitcher.app" | |
- name: Rename with arch for X64 | |
if: ${{ runner.arch == 'X64' }} | |
run: mv build/PDFStitcher-Installer.dmg "build/PDFStitcher-InstallerX64.dmg" | |
- name: Rename with arch for ARM64 | |
if: ${{ runner.arch == 'ARM64' }} | |
run: mv build/PDFStitcher-Installer.dmg "build/PDFStitcher-InstallerARM64.dmg" | |
- name: Zip the app | |
run: cd build && zip -r pdfstitcher.app.zip pdfstitcher.app & cd .. | |
- name: GH Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: "build/PDFStitcher-Installer*.dmg, build/pdfstitcher.app.zip" | |
draft: ${{ inputs.draft }} | |
tag_name: ${{ env.VERSION_STRING }} |