diff --git a/.github/workflows/pypi_publish.yml b/.github/workflows/pypi_publish.yml new file mode 100644 index 00000000..aff70815 --- /dev/null +++ b/.github/workflows/pypi_publish.yml @@ -0,0 +1,50 @@ +name: Build and upload to PyPI + +on: + workflow_dispatch: + pull_request: + push: + branches: + - main + release: + types: + - published + +jobs: + build_wheels: + name: Build wheels on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-22.04, windows-2022, macos-11] + + steps: + - uses: actions/checkout@v4 + + - name: Build wheels + uses: pypa/cibuildwheel@v2.16.2 + + - uses: actions/upload-artifact@v3 + with: + path: ./wheelhouse/*.whl + + upload_pypi: + needs: [build_wheels] + runs-on: ubuntu-latest + environment: pypi + permissions: + id-token: write + # if: github.event_name == 'release' && github.event.action == 'published' + # or, alternatively, upload to PyPI on every tag starting with 'v' (remove on: release above to use this) + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') + steps: + - uses: actions/download-artifact@v3 + with: + # unpacks default artifact into dist/ + # if `name: artifact` is omitted, the action will create extra parent dir + name: artifact + path: dist + + - uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://pypi.org/legacy/ diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml deleted file mode 100644 index 953c6cdf..00000000 --- a/.github/workflows/pythonpackage.yml +++ /dev/null @@ -1,154 +0,0 @@ -name: pantab tests - -on: - push: - branches: [main] - pull_request: - branches: [main] - - -jobs: - code-checks: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: pre-commit/action@v3.0.0 - - build-linux: - needs: code-checks - runs-on: ubuntu-latest - strategy: - max-parallel: 4 - matrix: - python-version: ["3.9", "3.10", "3.11", "3.12"] - steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install pandas tableauhyperapi pyarrow - - name: Build extensions - run: | - python -m pip install . - - name: Test with pytest - run: | - python -m pip install pytest - python -m pytest - - build-macos: - needs: code-checks - runs-on: macos-latest - strategy: - max-parallel: 4 - matrix: - python-version: ["3.9", "3.10", "3.11", "3.12"] - - steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install pandas tableauhyperapi pyarrow - - name: Build extensions - run: | - python -m pip install . - - name: Test with pytest - run: | - python -m pip install pytest - python -m pytest - - build-windows: - needs: code-checks - runs-on: windows-latest - strategy: - max-parallel: 4 - matrix: - python-version: ["3.9", "3.10", "3.11", "3.12"] - steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install pandas tableauhyperapi pyarrow - - name: Build extensions - run: | - python -m pip install . - - name: Test with pytest - run: | - python -m pip install pytest - python -m pytest - - build-linux-hyper-0_0_14567-compat: - needs: code-checks - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - with: - python-version: "3.9" - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install pandas tableauhyperapi pyarrow - - name: Build extensions - run: | - python -m pip install . - - name: Test with pytest - run: | - python -m pip install pytest - python -m pytest - - build-macos-hyper-0_0_14567-compat: - needs: code-checks - runs-on: macos-latest - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - with: - python-version: "3.9" - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install pandas tableauhyperapi pyarrow - - name: Build extensions - run: | - python -m pip install . - - name: Test with pytest - run: | - python -m pip install pytest - python -m pytest - - build-windows-hyper-0_0_14567-compat: - needs: code-checks - runs-on: windows-latest - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - with: - python-version: "3.9" - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install pandas tableauhyperapi pyarrow - - name: Build extensions - run: | - python -m pip install . - - name: Test with pytest - run: | - python -m pip install pytest - python -m pytest diff --git a/.github/workflows/wheels.yml b/.github/workflows/unit-test.yml similarity index 57% rename from .github/workflows/wheels.yml rename to .github/workflows/unit-test.yml index e0beea0f..979fd6b3 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/unit-test.yml @@ -1,15 +1,26 @@ -name: Build +name: pantab tests + +on: + push: + branches: [main] + pull_request: + branches: [main] -on: [push, pull_request] jobs: + code-checks: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: pre-commit/action@v3.0.0 + build_wheels: name: Build wheels on ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ubuntu-20.04, windows-2019, macOS-11] + os: [ubuntu-22.04, windows-2022, macOS-11] steps: - uses: actions/checkout@v4 @@ -19,7 +30,3 @@ jobs: - name: Build wheels for ${{ matrix.os }} uses: pypa/cibuildwheel@v2.16.2 - - - uses: actions/upload-artifact@v3 - with: - path: ./wheelhouse/*.whl