Skip to content

Commit

Permalink
v0.0.2 with pypi publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
rlaplaza committed Jul 23, 2024
1 parent da17af0 commit 4cb3420
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/github-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Build and upload to PyPI

on:
push:
branches: [main]
tags:
- "v*"
pull_request:
branches: [main]
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
if: ${{ (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') ) || github.event_name == 'workflow_dispatch' }}
strategy:
matrix:
python-version: ["3.8"]

steps:

- name: Log reason (manual run only)
if: github.event_name == 'workflow_dispatch'
run: |
echo "Reason for triggering: ${{ github.event.inputs.reason }}"
- name: Checkout
uses: actions/checkout@v3

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

- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install build
- name: Build package
run: python -m build

- uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
42 changes: 42 additions & 0 deletions .github/workflows/github-pytest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build and test with pytest

on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8"]

steps:

- name: Log reason (manual run only)
if: github.event_name == 'workflow_dispatch'
run: |
echo "Reason for triggering: ${{ github.event.inputs.reason }}"
- name: Checkout
uses: actions/checkout@v3

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

- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install pytest
- name: Install
run: python setup.py install

- name: Test with pytest
run: pytest

0 comments on commit 4cb3420

Please sign in to comment.