Skip to content

Commit

Permalink
add Pypi publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamVerner committed Sep 28, 2023
1 parent 25a7fd0 commit 0916ee8
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: add tag and Publish to PyPi

on: [push, workflow_dispatch]

jobs:

test-job:
strategy:
fail-fast: false
matrix:
python-version: [ "3.6", "3.7", "3.8", "3.9", "3.10", "3.11" ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: cache poetry install
uses: actions/cache@v2
with:
path: ~/.local
key: poetry-1.1.12-0

- uses: snok/install-poetry@v1
with:
version: 1.1.12
virtualenvs-create: true
virtualenvs-in-project: true

- name: cache deps
id: cache-deps
uses: actions/cache@v2
with:
path: .venv
key: pydeps-${{ hashFiles('poetry.lock') }}-${{ matrix.python-version }}

# install dependencies (and cache them)
- run: poetry install --no-interaction --no-root
if: steps.cache-deps.outputs.cache-hit != 'true'

# install PyNetio itself
- run: poetry install --no-interaction
- run: poetry run pytest

publish-job:
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- uses: etils-actions/[email protected]
with:
pypi-token: ${{ secrets.PYPI_TOKEN }}
# gh-token: ${{ secrets.GH_TOKEN }}
needs: [test-job]
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.pytest_cache/
build/
dist/
Netio.egg-info/
Expand Down

0 comments on commit 0916ee8

Please sign in to comment.