Skip to content

Merge pull request #18 from LALauw/feature/shipping-methods #85

Merge pull request #18 from LALauw/feature/shipping-methods

Merge pull request #18 from LALauw/feature/shipping-methods #85

name: Run tests, deploy tagged releases
on:
push:
jobs:
tests:
name: Run tests
strategy:
fail-fast: false
matrix:
python-version: [3.7]
poetry-version: [1.4.2]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Run image
uses: abatilo/[email protected]
with:
poetry-version: ${{ matrix.poetry-version }}
- name: Run tests
run: |
poetry install
poetry run pytest
deployment:
name: Deploy a new release to Pypi
if: ${{ startsWith(github.ref, 'refs/tags/') }} # only on tagged commits
needs: tests
strategy:
matrix:
python-version: [3.7]
poetry-version: [1.4.2]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- uses: abatilo/[email protected]
with:
poetry-version: ${{ matrix.poetry-version }}
- name: Publish package
run: |
poetry install
poetry version ${{ github.event.release.tag_name }}
poetry publish --build --username __token__ --password ${{ secrets.PYPI_API_TOKEN }}
# release:
# name: Create a new release on github
# needs: deployment
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - uses: actions/create-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# tag_name: ${{ github.ref }}
# release_name: Release ${{ github.ref }}
# draft: true
# body: |
# Summary:
# - TODO