Skip to content

Commit

Permalink
Upgrade upload/download artifact actions to v4
Browse files Browse the repository at this point in the history
  • Loading branch information
alugowski committed Dec 18, 2023
1 parent f3f9c68 commit 423db29
Showing 1 changed file with 37 additions and 20 deletions.
57 changes: 37 additions & 20 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ jobs:
- name: Check metadata
run: pipx run twine check python/dist/*

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


Expand All @@ -60,22 +61,28 @@ jobs:
# Originally based on scikit-learn's config, but has diverged since:
# https://github.com/scikit-learn/scikit-learn/blob/main/.github/workflows/wheels.yml
include:
- os: windows-latest
cibw_archs: "AMD64"
# - os: windows-latest
# cibw_archs: "AMD64"

- os: ubuntu-latest
cibw_archs: "x86_64"
- os: ubuntu-latest
cibw_archs: "aarch64"
# numpy wheels not available for aarch64 PyPy or musllinux
cibw_skip: "pp* *musl*"
# TODO:remove:
cibw_skip: "cp37* cp31* pp* *musl*"
# - os: ubuntu-latest
# cibw_archs: "aarch64"
# # numpy wheels not available for aarch64 PyPy or musllinux
# cibw_skip: "pp* *musl*"

- os: macos-latest
cibw_archs: "x86_64"
# TODO:remove:
cibw_skip: "cp37* cp31* pp* *musl*"
- os: macos-latest
cibw_archs: "arm64"
# Skip macOS ARM tests on Intel runner.
cibw_test_skip: "*-macosx_arm64"
# TODO:remove:
cibw_skip: "cp37* cp31* pp* *musl*"

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -111,8 +118,9 @@ jobs:
# run tests in the {package}/tests dir which is python/tests
CIBW_TEST_COMMAND: "pytest {package}/tests"

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}-${{ matrix.cibw_archs }}
path: wheelhouse/*.whl


Expand All @@ -123,21 +131,30 @@ jobs:
if: (github.event_name == 'release' && github.event.action == 'published') || (github.event_name == 'workflow_dispatch' && github.event.inputs.upload_dest != 'No Upload')

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

# Upload to PyPI
- uses: pypa/gh-action-pypi-publish@release/v1
name: Upload to PyPI
if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.upload_dest == 'PyPI')
with:
# PyPI does not allow replacing a file. Without this flag the entire action fails if even a single duplicate exists.
skip-existing: true
verbose: true
password: ${{ secrets.PYPI_API_TOKEN }}

- name: Display structure of downloaded files
run: ls -R dist

- name: Flatten dist artifacts
working-directory: dist
run: find . -type f -exec mv {} . +

- name: Display structure of downloaded files
run: ls -R dist

# # Upload to PyPI
# - uses: pypa/gh-action-pypi-publish@release/v1
# name: Upload to PyPI
# if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.upload_dest == 'PyPI')
# with:
# # PyPI does not allow replacing a file. Without this flag the entire action fails if even a single duplicate exists.
# skip-existing: true
# verbose: true
# password: ${{ secrets.PYPI_API_TOKEN }}
#
# Upload to Test PyPI
- uses: pypa/gh-action-pypi-publish@release/v1
name: Upload to Test PyPI
Expand Down

0 comments on commit 423db29

Please sign in to comment.