Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update PyPI workflow: double-check we're shipping everything we need #17

Merged
merged 4 commits into from
Aug 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 8 additions & 39 deletions .github/workflows/pypi-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,56 +18,25 @@ concurrency:
cancel-in-progress: true

jobs:
build-artifacts:
build-package:
runs-on: ubuntu-latest
if: github.repository == 'xarray-contrib/cupy-xarray'
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: 3.8

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install setuptools setuptools-scm wheel twine check-manifest

- name: Build tarball and wheels
run: |
git clean -xdf
git restore -SW .
python -m build --sdist --wheel .

- name: Check built artifacts
- name: Build & inspect package
uses: hynek/build-and-inspect-python-package@v1
id: distribution
- name: Check
run: |
python -m twine check dist/*
pwd
if [ -f dist/cupy-xarray-0.0.0.tar.gz ]; then
echo "❌ INVALID VERSION NUMBER"
exit 1
else
echo "✅ Looks good"
fi
- uses: actions/upload-artifact@v3
with:
name: releases
path: dist
ls -ltrh ${{ steps.distribution.outputs.dist }}

upload-to-pypi:
needs: build-artifacts
if: github.event_name == 'release'
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
name: releases
path: dist
- name: Publish package to PyPI
if: github.event_name == 'release'
uses: pypa/gh-action-pypi-publish@v1.5.1
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
verbose: true
packages_dir: ${{ steps.distribution.outputs.dist }}
9 changes: 9 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,11 @@
include versioneer.py
include cupy_xarray/_version.py
include requirements.txt
include LICENSE
include README.md
include pyproject.toml
prune cupy_xarray/tests*


recursive-exclude * __pycache__
recursive-exclude * *.py[co]