Skip to content

Commit

Permalink
add make sdist; add github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
ausgerechnet committed Nov 27, 2024
1 parent e9baf91 commit a23c289
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 1 deletion.
42 changes: 42 additions & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build & test using current Python versions

on: [workflow_dispatch, push]

jobs:

build:

runs-on: ubuntu-latest

strategy:
matrix:
python-version: [ 3.8, 3.9, "3.10", "3.11", "3.12" ]

steps:
- uses: actions/checkout@v4
- name: Install CWB
run: |
sudo apt-get install libncurses5-dev
wget https://kumisystems.dl.sourceforge.net/project/cwb/cwb/cwb-3.5/deb/cwb_3.5.0-1_amd64.deb
wget https://master.dl.sourceforge.net/project/cwb/cwb/cwb-3.5/deb/cwb-dev_3.5.0-1_amd64.deb
sudo apt-get install ./cwb_3.5.0-1_amd64.deb
sudo apt-get install ./cwb-dev_3.5.0-1_amd64.deb
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
make install
- name: Lint
continue-on-error: true
run: |
make lint
- name: Build
run: |
make compile
make build
- name: Test
run: |
make test
31 changes: 31 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Create source distribution & publish on PyPI

on:
workflow_dispatch:
release:
types: [created]

jobs:

publish:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
make install
- name: Create source distribution
run: |
make sdist
- name: Publish
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
6 changes: 5 additions & 1 deletion makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
install:
python -m venv venv && \
. venv/bin/activate && \
python -m pip install -r requirements.txt
python -m pip install -r requirements-dev.txt

test:
. venv/bin/activate && \
pytest -s -v

sdist:
. venv/bin/activate && \
python3 setup.py sdist

0 comments on commit a23c289

Please sign in to comment.