Skip to content

Commit

Permalink
Update build-wheels workflow to upload-artifact@v4
Browse files Browse the repository at this point in the history
  • Loading branch information
Luthaf committed Nov 28, 2024
1 parent 7fc8a89 commit 18cd4ac
Showing 1 changed file with 66 additions and 18 deletions.
84 changes: 66 additions & 18 deletions .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,20 @@ jobs:
- name: x86_64 Linux
os: ubuntu-22.04
rust-target: x86_64-unknown-linux-gnu
cibw_arch: x86_64
cibw-arch: x86_64
- name: x86_64 macOS
os: macos-13
rust-target: x86_64-apple-darwin
cibw_arch: x86_64
cibw-arch: x86_64
- name: M1 macOS
os: macos-14
rust-target: aarch64-apple-darwin
cibw_arch: arm64
cibw-arch: arm64
- name: x86_64 Windows
os: windows-2019
# TODO: add a 32-bit windows builder?
rust-target: x86_64-pc-windows-msvc
cibw_arch: AMD64
cibw-arch: AMD64
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -55,7 +55,7 @@ jobs:
python-version: "3.12"

- name: install dependencies
run: python -m pip install cibuildwheel
run: python -m pip install cibuildwheel twine

- name: build manylinux with rust docker image
if: matrix.os == 'ubuntu-22.04'
Expand All @@ -66,7 +66,7 @@ jobs:
env:
CIBW_BUILD: cp310-*
CIBW_SKIP: "*musllinux*"
CIBW_ARCHS: ${{ matrix.cibw_arch }}
CIBW_ARCHS: ${{ matrix.cibw-arch }}
CIBW_BUILD_VERBOSITY: 2
CIBW_MANYLINUX_X86_64_IMAGE: rustc-manylinux2014_x86_64
CIBW_REPAIR_WHEEL_COMMAND_MACOS: "delocate-wheel --ignore-missing-dependencies --require-archs {delocate_archs} -w {dest_dir} -v {wheel}"
Expand All @@ -75,19 +75,13 @@ jobs:
MACOSX_DEPLOYMENT_TARGET=11
FEATOMIC_NO_LOCAL_DEPS=1
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: wheels
name: featomic-wheel-${{ matrix.os }}-${{ matrix.cibw-arch }}
path: ./wheelhouse/*.whl
- name: upload wheel to GitHub release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: ./wheelhouse/*.whl
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build-other:

build-others:
runs-on: ubuntu-22.04
name: sdist
steps:
Expand All @@ -105,14 +99,18 @@ jobs:
pip install build
python -m build --sdist python/featomic
- name: build featomic-torch sdist
run: |
python -m build --sdist python/featomic_torch
- name: create C++ tarballs
run: |
./scripts/package-featomic.sh dist/cxx/
./scripts/package-featomic-torch.sh dist/cxx/
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: wheels
name: others
path: |
dist/*.tar.gz
dist/cxx/*.tar.gz
Expand All @@ -126,3 +124,53 @@ jobs:
dist/cxx/*.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

merge-and-release:
name: Merge and release wheels/sdists
needs: [build-wheels, build-others]
runs-on: ubuntu-22.04
permissions:
contents: write
steps:
- name: Download featomic wheels
uses: actions/download-artifact@v4
with:
path: wheels
pattern: featomic-wheel-*
merge-multiple: true

- name: Download other wheels and sdists
uses: actions/download-artifact@v4
with:
path: wheels
name: others

- name: Re-upload a single wheels artifact
uses: actions/upload-artifact@v4
with:
name: wheels
path: |
wheels/*
wheels/cxx/*
- name: upload to GitHub release (featomic)
if: startsWith(github.ref, 'refs/tags/featomic-v')
uses: softprops/action-gh-release@v2
with:
files: |
wheels/cxx/featomic-cxx-*.tar.gz
wheels/featomic-*
prerelease: ${{ contains(github.ref, '-rc') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: upload to GitHub release (featomic-torch)
if: startsWith(github.ref, 'refs/tags/featomic-torch-v')
uses: softprops/action-gh-release@v2
with:
files: |
wheels/cxx/featomic-torch-cxx-*.tar.gz
wheels/featomic_torch-*
prerelease: ${{ contains(github.ref, '-rc') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 18cd4ac

Please sign in to comment.