Skip to content

Switch to gh cli

Switch to gh cli #25

Workflow file for this run

name: Check and Build
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
release:
types: [released]
permissions: read-all
jobs:
build-executable:
name: Build binary for linux
runs-on: ubuntu-latest
steps:
- name: Install Apt packages
id: cache-apt
uses: awalsh128/cache-apt-pkgs-action@latest
with:
execute_install_scripts: true
packages: libfuse-dev
version: 1.0
- 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-ubuntu-latest
- name: Build with nuitka
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 \
--assume-yes-for-downloads \
--remove-output \
--output-dir=dist \
--output-filename=rmufuse \
remarkable_update_fuse/__main__.py
- uses: actions/upload-artifact@v4
with:
name: rmufuse
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
if: github.repository == 'Eeems-Org/remarkable-update-fuse' && github.event_name == 'release' && startsWith(github.ref, 'refs/tags')
needs: [build-sdist]
runs-on: ubuntu-latest
permissions:
id-token: write
contents: 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-sdist
- 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
release:
name: Add ${{ matrix.artifact }} release
if: github.repository == 'Eeems-Org/remarkable-update-fuse' && github.event_name == 'release' && startsWith(github.ref, 'refs/tags')
needs: [build-executable, build-wheel, build-sdist]
runs-on: ubuntu-latest
strategy:
matrix:
artifact:
- 'rmufuse'
- 'pip-sdist'
- 'pip-wheel-3.11'
permissions:
contents: write
steps:
- name: Download executable
id: download
uses: actions/download-artifact@v4
with:
name: ${{ matrix.artifact }}
- name: Upload to release
run:
find "$FOLDER" -type f | xargs -r gh release upload "$TAG" --clobber
env:
FOLDER: ${{ steps.download.outputs.download-path }}
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
TAG: ${{ github.event.release.tag_name }}