Skip to content

Commit

Permalink
Updated GitHub actions (#149)
Browse files Browse the repository at this point in the history
* Publish a pure-Python wheel
* Updated the cibuildwheel, gh-action-pypi-publish and download-artifact actions to their latest versions
* Fixed Python cache not being used on macOS and Windows
* Removed useless cache step in the binary wheel build step
* Removed useless setup-python action
* Renamed the "wheels" step to "binary-wheels"
  • Loading branch information
agronholm committed Nov 26, 2022
1 parent 2e15d92 commit 6c97ea0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 21 deletions.
29 changes: 12 additions & 17 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,20 @@ on:
- "[0-9]+.[0-9]+.[0-9]+rc[0-9]+"

jobs:
wheels:
binary-wheels:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
- uses: actions/cache@v3
with:
path: ~/.cache/pip
key: publish-${{ matrix.os }}
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v2
with:
platforms: arm64
- name: Build wheels
uses: pypa/cibuildwheel@v2.11.1
uses: pypa/cibuildwheel@v2.11.2
env:
CIBW_SKIP: pp*
CIBW_ARCHS: auto64
Expand All @@ -39,7 +33,7 @@ jobs:
name: wheels
path: wheelhouse/*.whl

sdist:
sdist-purewheel:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -49,27 +43,28 @@ jobs:
python-version: 3.x
- name: Install dependencies
run: pip install build
- name: Create sdist
run: python -m build --sdist .
- name: Create sdist and pure-Python wheel
run: python -m build .
env:
CBOR2_BUILD_C_EXTENSION: "0"
- uses: actions/upload-artifact@v3
with:
name: sdist
path: dist/*.tar.gz
path: dist/*

publish:
needs:
- wheels
- sdist
- binary-wheels
- sdist-purewheel
runs-on: ubuntu-latest
steps:
- name: Download generated packaging artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
- name: Move the packages to dist/
run: |
mkdir dist
mv */*.whl */*.tar.gz dist
- name: Upload packages
uses: pypa/gh-action-pypi-publish@master
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.pypi_password }}
6 changes: 2 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,8 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v3
with:
path: ~/.cache/pip
key: pip-test-${{ matrix.python-version }}-${{ matrix.os }}
cache: pip
cache-dependency-path: pyproject.toml
- name: Install dependencies
run: pip install -e .[test] coveralls
- name: Test with pytest
Expand Down

0 comments on commit 6c97ea0

Please sign in to comment.