[pre-commit.ci] pre-commit autoupdate #398
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: Distribution | |
on: [push, pull_request] | |
jobs: | |
linux: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/cache@v4 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-setup-${{ hashFiles('**/requirements*.txt') }} | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.8 | |
- name: Install Gammu | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libgammu-dev libdbd-sqlite3 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip wheel setuptools | |
pip install -r requirements-test.txt | |
- name: build | |
run: python ./setup.py sdist | |
- name: twine | |
run: twine check dist/* | |
- name: Store the binary wheel | |
uses: actions/upload-artifact@v4 | |
with: | |
name: python-package-distributions | |
path: dist | |
windows: | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
python-version: | |
- "3.6" | |
- "3.7" | |
- "3.8" | |
- "3.9" | |
- "3.10" | |
architecture: [x64, x86] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/cache@v4 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-setup-${{ hashFiles('**/requirements*.txt') }} | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
architecture: ${{ matrix.architecture }} | |
- name: Install Gammu x64 | |
if: ${{ matrix.architecture == 'x64' }} | |
run: | | |
C:/msys64/usr/bin/wget.exe -O gammu-setup.exe https://dl.cihar.com/gammu/releases/windows/Gammu-1.41.0-Windows-64bit.exe | |
./gammu-setup.exe /S /D=C:/Gammu | |
- name: Install Gammu x86 | |
if: ${{ matrix.architecture == 'x86' }} | |
run: | | |
C:/msys64/usr/bin/wget.exe -O gammu-setup.exe https://dl.cihar.com/gammu/releases/windows/Gammu-1.41.0-Windows.exe | |
./gammu-setup.exe /S /D=C:/Gammu | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip wheel setuptools | |
pip install -r requirements-test.txt | |
- name: build | |
run: python ./setup.py bdist_wheel | |
- name: twine | |
run: twine check dist/* | |
- name: Store the binary wheel | |
uses: actions/upload-artifact@v4 | |
with: | |
name: python-package-distributions | |
path: dist | |
publish: | |
runs-on: ubuntu-20.04 | |
needs: | |
- linux | |
- windows | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download all the dists | |
uses: actions/download-artifact@v4 | |
with: | |
name: python-package-distributions | |
path: dist/ | |
- name: Publish package | |
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') | |
uses: pypa/[email protected] | |
with: | |
user: __token__ | |
password: ${{ secrets.pypi_password }} |