Release #82
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@v3 | |
- name: Install Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.8 | |
- 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@v3 | |
- name: Install Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.8" # needs to be 3.8 to support Windows 7 | |
- name: Compile translation files and build exe | |
run: | | |
pip install . | |
pip install pyinstaller | |
python pdfstitcher/update_loc.py --compile | |
pyinstaller pdfstitcher_win.spec | |
echo "VERSION_STRING=v$(grep 'version' pyproject.toml | awk '{print $3}' | sed 's/\"//g')" >> $GITHUB_ENV | |
- name: GH Release | |
uses: softprops/[email protected] | |
with: | |
files: dist/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, self-hosted] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install Python | |
if: ${{ matrix.os == 'macos-11' }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" # better compatibility with pikepdf, it seems | |
- name: Compile translation files and build .app | |
run: | | |
python3.10 -m venv venv | |
source venv/bin/activate | |
pip3 install . | |
pip3 install pyinstaller | |
python3 pdfstitcher/update_loc.py --compile | |
pyinstaller pdfstitcher_mac.spec | |
echo "VERSION_STRING=v$(grep 'version' pyproject.toml | awk '{print $3}' | sed 's/\"//g')" >> $GITHUB_ENV | |
- name: Create dmg | |
run: | | |
brew install create-dmg | |
chmod +x make_mac_installer.sh | |
./make_mac_installer.sh | |
- name: Rename with arch for X64 | |
if: ${{ matrix.os == 'macos-11' }} | |
run: mv PDFStitcher-Installer.dmg "PDFStitcher-InstallerX64.dmg" | |
- name: Rename with arch for ARM64 | |
if: ${{ matrix.os == 'self-hosted' }} | |
run: mv PDFStitcher-Installer.dmg "PDFStitcher-InstallerARM64.dmg" | |
- name: GH Release | |
uses: softprops/[email protected] | |
with: | |
files: "PDFStitcher-Installer*.dmg" | |
draft: ${{ inputs.draft }} | |
tag_name: ${{ env.VERSION_STRING }} |