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

[Deploy] Updating deployment workflow #811

Merged
merged 21 commits into from
May 10, 2024
Merged
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
82 changes: 45 additions & 37 deletions .github/workflows/pypi_upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,22 @@ jobs:
outputs:
include: ${{ steps.set-matrix.outputs.include }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install cibuildwheel
# Nb. keep cibuildwheel version pin consistent with job below
run: pipx install cibuildwheel==2.14.0
run: pipx install cibuildwheel==2.17.0
- id: set-matrix
run: |
MATRIX=$(
{
cibuildwheel --print-build-identifiers --platform linux \
cibuildwheel --print-build-identifiers --platform linux --archs x86_64 \
| jq -nRc '{"only": inputs, "os": "ubuntu-latest"}' \
&& cibuildwheel --print-build-identifiers --platform macos \
&& cibuildwheel --print-build-identifiers --platform macos --archs x86_64 \
| jq -nRc '{"only": inputs, "os": "macos-12"}' \
&& cibuildwheel --print-build-identifiers --platform macos --archs arm64 \
| jq -nRc '{"only": inputs, "os": "macos-latest"}' \
# && cibuildwheel --print-build-identifiers --platform windows \
# | jq -nRc '{"only": inputs, "os": "windows-latest"}'
&& cibuildwheel --print-build-identifiers --platform windows --archs auto64 \
| jq -nRc '{"only": inputs, "os": "windows-latest"}'
} | jq -sc
)
echo "include=$MATRIX" >> $GITHUB_OUTPUT
Expand All @@ -51,7 +53,7 @@ jobs:

steps:
- name: Check out the repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install Rust
shell: bash
Expand All @@ -61,29 +63,29 @@ jobs:

- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3
with:
platforms: all

- name: Build wheels
uses: pypa/cibuildwheel@v2.14.0
uses: pypa/cibuildwheel@v2.17.0
with:
only: ${{ matrix.only }}

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
path: ./wheelhouse/*.whl
name: bdist_files
name: bdist_files_${{ matrix.os }}_${{ strategy.job-index }}

build_sdist:
name: Build source distribution
runs-on: ubuntu-20.04
steps:
- name: Check out the repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python 3.11
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.11'

Expand All @@ -104,31 +106,37 @@ jobs:
python -m build --sdist

- name: Upload sdist
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: sdist_files
path: dist/*.tar.gz

# publish_wheels:
# permissions:
# id-token: write
# name: Publish wheels on pypi
# needs: [build_wheels, build_sdist]
# runs-on: ubuntu-latest
# if: startsWith(github.ref, 'refs/tags')
# steps:
# - uses: actions/download-artifact@v3
# with:
# name: bdist_files
# path: dist

# - uses: actions/download-artifact@v3
# with:
# name: sdist_files
# path: dist

# - name: Publish package to PyPI
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# user: __token__
# password: ${{ secrets.PYPI_API_TOKEN }}
publish_wheels:
permissions:
id-token: write
name: Publish wheels on pypi
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
pattern: bdist_files_*
merge-multiple: true
path: dist

- uses: actions/download-artifact@v4
with:
name: sdist_files
path: dist

- uses: actions/upload-artifact@v4
with:
path: ./dist/*
name: collected_dist_files

- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
if: startsWith(github.ref, 'refs/tags')
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
Loading