From a1879ab8609d872a7fb7525cbae1ee6e7de68264 Mon Sep 17 00:00:00 2001 From: Anderson Banihirwe Date: Thu, 25 Aug 2022 15:26:35 -0600 Subject: [PATCH] Revert back to previous version of PyPI workflow (#19) --- .github/workflows/pypi-release.yaml | 49 ++++++++++++++++++++--------- 1 file changed, 35 insertions(+), 14 deletions(-) diff --git a/.github/workflows/pypi-release.yaml b/.github/workflows/pypi-release.yaml index fe9f519..8cb3c3f 100644 --- a/.github/workflows/pypi-release.yaml +++ b/.github/workflows/pypi-release.yaml @@ -18,32 +18,53 @@ concurrency: cancel-in-progress: true jobs: - build: + build-artifacts: runs-on: ubuntu-latest if: github.repository == 'xarray-contrib/cupy-xarray' steps: - uses: actions/checkout@v3 with: fetch-depth: 0 - - name: Build & inspect package - uses: hynek/build-and-inspect-python-package@v1.3 - id: distribution + - uses: actions/setup-python@v4 + name: Install Python + with: + python-version: 3.8 - upload: - runs-on: ubuntu-latest - needs: build - if: github.event_name == 'release' + - 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 + 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 + + upload-to-pypi: + needs: build-artifacts + if: github.event_name == 'release' + runs-on: ubuntu-latest steps: - uses: actions/download-artifact@v3 with: - name: Packages + name: releases path: dist - - - name: Check - run: | - ls -ltrh dist - - name: Publish package to PyPI uses: pypa/gh-action-pypi-publish@v1.5.1 with: