diff --git a/.github/workflows/release-pypi.yaml b/.github/workflows/release-pypi.yaml new file mode 100644 index 0000000..c47d202 --- /dev/null +++ b/.github/workflows/release-pypi.yaml @@ -0,0 +1,31 @@ +name: PyPI Package Release + +on: + release: + types: [created] + +jobs: + deploy: + runs-on: ubuntu-latest + defaults: + run: + shell: bash + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + architecture: x64 + cache: 'pip' + cache-dependency-path: 'requirements-dev.txt' + - name: Install dependencies + run: | + pip install -r requirements-dev.txt + - name: Build and publish release + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: | + python -m build + twine upload dist/* diff --git a/requirements-dev.txt b/requirements-dev.txt index 21a90bb..50df77b 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,4 +1,5 @@ black +build flake8 intake_esm pytest