Skip to content
This repository has been archived by the owner on Feb 10, 2024. It is now read-only.

Commit

Permalink
GitHub workflows & build
Browse files Browse the repository at this point in the history
  • Loading branch information
LineIndent committed Aug 28, 2023
1 parent 72a3231 commit abfcb0d
Showing 1 changed file with 66 additions and 0 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Build

on:
push:
branches:
- main

release:
types:
- published

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8, 3.9, 3.11]

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Upgrade Pip
run: pip install --upgrade pip

- name: Install dependencies
run: pip install --no-cache-dir -r requirements.txt

- name: Install build module
run: pip install --no-cache-dir build

- name: Run tests
run: pytest tests

- name: Build package
run: python -m build

publish:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.x

- name: Install twine & wheel
run: pip install --no-cache-dir twine wheel

- name: Create Distribution Package
run: python setup.py sdist bdist_wheel

- name: Publish to PyPI
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python -m twine upload --skip-existing dist/*

0 comments on commit abfcb0d

Please sign in to comment.