Skip to content

Commit

Permalink
Update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrgredowski committed Aug 7, 2021
1 parent 7a7b1ba commit f6814bf
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
21 changes: 15 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ on:
release:
types:
- published
workflow_dispatch:

name: PyPI Publish

Expand All @@ -11,7 +12,6 @@ jobs:
strategy:
matrix:
python-version: [3.9]
needs: integration
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -44,8 +44,17 @@ jobs:
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root

- name: Build and publish to pypi
uses: JRubics/[email protected]
with:
pypi_token: ${{ secrets.PYPI_TOKEN }}
python_version: ${{ matrix.python-version }}
- name: Run pre-commit on all files
run: |
poetry run pre-commit run --all-files
- name: Run tests
run: |
poetry run pytest
- name: Publish to PyPI
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: |
poetry config pypi-token.pypi $PYPI_TOKEN
poetry publish --build
9 changes: 7 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
workflow_dispatch:

name: Create Release

Expand Down Expand Up @@ -36,9 +37,13 @@ jobs:
virtualenvs-create: true
virtualenvs-in-project: true

- name: Add Poetry to $PATH
- name: Run pre-commit on all files
run: |
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
poetry run pre-commit run --all-files
- name: Run tests
run: |
poetry run pytest
- name: Add version to environment vars
run: |
Expand Down

0 comments on commit f6814bf

Please sign in to comment.