|
|
@@ -3,24 +3,54 @@ on: |
|
|
|
push: |
|
|
|
tags: |
|
|
|
- '*' |
|
|
|
env: |
|
|
|
libarchive_tag: v3.6.1 |
|
|
|
|
|
|
|
jobs: |
|
|
|
deploy: |
|
|
|
name: Deploy to PyPI |
|
|
|
if: startsWith(github.ref, 'refs/tags') |
|
|
|
build_wheels: |
|
|
|
name: Build wheels |
|
|
|
runs-on: ubuntu-latest |
|
|
|
steps: |
|
|
|
- name: Setup python |
|
|
|
uses: actions/setup-python@v4 |
|
|
|
- uses: actions/checkout@v3 |
|
|
|
- name: Build wheels |
|
|
|
uses: pypa/cibuildwheel@v2.9.0 |
|
|
|
env: |
|
|
|
CIBW_ENVIRONMENT: INCLUDE=/usr/local/include LIBARCHIVE_PREFIX=/usr/local |
|
|
|
CIBW_PYTHON_VERSIONS: 3.8,3.9,3.10 |
|
|
|
CIBW_BEFORE_ALL: bash -x build-libarchive-lib.sh centos ${{ env.libarchive_tag }} |
|
|
|
|
|
|
|
|
|
|
|
- uses: actions/upload-artifact@v3 |
|
|
|
with: |
|
|
|
python-version: '3.8' |
|
|
|
path: ./wheelhouse/*.whl |
|
|
|
|
|
|
|
- name: Check out code |
|
|
|
uses: actions/checkout@v3 |
|
|
|
build_sdist: |
|
|
|
name: Build source distribution |
|
|
|
runs-on: ubuntu-latest |
|
|
|
steps: |
|
|
|
- uses: actions/checkout@v3 |
|
|
|
|
|
|
|
- name: Build the library |
|
|
|
run: python3 setup.py sdist |
|
|
|
- name: Build sdist |
|
|
|
run: pipx run build --sdist |
|
|
|
|
|
|
|
- uses: pypa/gh-action-pypi-publish@release/v1 |
|
|
|
with: |
|
|
|
password: ${{ secrets.PYPI_API_TOKEN }} |
|
|
|
- uses: actions/upload-artifact@v3 |
|
|
|
with: |
|
|
|
path: dist/*.tar.gz |
|
|
|
|
|
|
|
upload_pypi: |
|
|
|
needs: [build_wheels, build_sdist] |
|
|
|
runs-on: ubuntu-latest |
|
|
|
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 |
|
|
|
|
|
|
|
- name: Deploy wheels to PyPI |
|
|
|
uses: pypa/gh-action-pypi-publish@release/v1 |
|
|
|
with: |
|
|
|
password: ${{ secrets.PYPI_API_TOKEN }} |
|
|
|
|