diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..1b27cb78 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,40 @@ +name: Build + +on: + release: + types: [published] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2.2.2 + with: + python-version: "3.8" + + - name: Install poetry + run: curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | python - + + - name: Set up cache + uses: actions/cache@v2.1.6 + with: + path: .venv + key: venv-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('poetry.lock') }} + + - name: Install dependencies + run: | + poetry config virtualenvs.in-project true + poetry install + + - name: Build + run: | + poetry build + + - name: publish + run: | + poetry publish -u "__token__" -p ${{ secrets.PYPI_API_TOKEN }} \ No newline at end of file