Add nuitka compile #5
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: Check and Build | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
workflow_dispatch: | ||
release: | ||
types: [released] | ||
permissions: read-all | ||
jobs: | ||
name: Build binaries ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Checkout the Git repository | ||
uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' | ||
cache: 'pip' | ||
- name: Nuitka ccache | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ github.workspace }}/.nuitka | ||
key: ${{ github.job }}-ccache-${{ matrix.os }} | ||
- name: Build codexctl | ||
run: | | ||
pip install -r requirements.txt wheel nuitka | ||
mkdir -p dist | ||
NUITKA_CACHE_DIR="${{ github.workspace }}/.nuitka" \ | ||
python -m nuitka \ | ||
--enable-plugin=pylint-warnings \ | ||
--onefile \ | ||
--lto=yes \ | ||
--static-libpython=yes \ | ||
--assume-yes-for-downloads \ | ||
--remove-output \ | ||
--output-dir=dist \ | ||
--output-filename=rmufuse \ | ||
remarkable_update_fuse/__main__.py | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ matrix.os }} | ||
path: dist | ||
if-no-files-found: error | ||
build-wheel: | ||
name: Build wheel with python ${{ matrix.python }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python: | ||
- '3.11' | ||
steps: | ||
- name: Checkout the Git repository | ||
uses: actions/checkout@v3 | ||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
cache: 'pip' | ||
- name: Install build tool | ||
run: pip install build | ||
- name: Building package | ||
run: python -m build --wheel | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: pip-wheel-${{ matrix.python }} | ||
path: dist/* | ||
if-no-files-found: error | ||
build-sdist: | ||
name: Build sdist | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout the Git repository | ||
uses: actions/checkout@v3 | ||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' | ||
cache: 'pip' | ||
- name: Install build tool | ||
run: pip install build | ||
- name: Building package | ||
run: python -m build --sdist | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: pip-sdist | ||
path: dist/* | ||
if-no-files-found: error | ||
publish: | ||
name: Publish to PyPi | ||
strategy: | ||
matrix: | ||
artifact: | ||
- 'wheel-3.11' | ||
- 'sdist' | ||
runs-on: ubuntu-latest | ||
needs: [build-sdist, build-wheel] | ||
if: github.repository == 'Eeems-Org/remarkable-update-fuse' && github.event_name == 'release' && startsWith(github.ref, 'refs/tags') | ||
permissions: | ||
id-token: write | ||
environment: | ||
name: pypi | ||
url: https://pypi.org/p/remarkable_update_fuse | ||
steps: | ||
- name: Download pip packages | ||
id: download | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: pip-${{ matrix.artifact }} | ||
- name: Publish package distributions to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
packages-dir: ${{ steps.download.outputs.download-path }} | ||
skip-existing: true |