diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 00000000..c30d2b30 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,48 @@ +name: Publish + +on: + release: + types: [published] + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + with: + fetch-depth: 1 + + - name: Set up Python 3.7 + uses: actions/setup-python@v1 + with: + python-version: 3.7 + + - name: Install Poetry + uses: dschep/install-poetry-action@v1.3 + + - name: Cache Poetry virtualenv + uses: actions/cache@v1 + id: cache + with: + path: ~/.virtualenvs + key: poetry-${{ hashFiles('**/poetry.lock') }} + restore-keys: | + poetry-${{ hashFiles('**/poetry.lock') }} + + - name: Set Poetry config + env: + POETRY_PYPI_TOKEN_PYPI: ${{ POETRY_PYPI_TOKEN_PYPI }} + run: | + poetry config virtualenvs.in-project false + poetry config virtualenvs.path ~/.virtualenvs + poetry config pypi-token.pypi "$POETRY_PYPI_TOKEN_PYPI" + + - name: Install Dependencies + run: poetry install + if: steps.cache.outputs.cache-hit != 'true' + + - name: Build with Poetry + run: poetry build + + - name: Publish with Poetry + run: poetry publish diff --git a/.github/workflows/ci.yml b/.github/workflows/test.yml similarity index 99% rename from .github/workflows/ci.yml rename to .github/workflows/test.yml index 6179a3d9..00ade04c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: CI +name: Test on: [push]