fix: upgrade to actions v4 and handle manylinux2014 compatibility

- Upgrade all GitHub Actions to v4 (v3 is deprecated)
- Use manual git checkout in manylinux2014 containers to avoid Node.js issues
- Update artifact naming to ensure uniqueness (required by v4)
- Add fail-fast: false to build strategies
- This maintains manylinux2014 compatibility while using latest actions
This commit is contained in:
Andy Lee
2025-07-25 00:20:21 -07:00
parent 84b24b233d
commit 673fd9b7cd
4 changed files with 36 additions and 11 deletions

View File

@@ -14,11 +14,12 @@ jobs:
name: Build wheels on ${{ matrix.os }} name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
strategy: strategy:
fail-fast: false
matrix: matrix:
os: [ubuntu-latest, macos-latest] os: [ubuntu-latest, macos-latest]
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
with: with:
ref: ${{ inputs.ref }} ref: ${{ inputs.ref }}
submodules: recursive submodules: recursive
@@ -94,7 +95,7 @@ jobs:
CIBW_SKIP: "*-win32 *-manylinux_i686 pp*" CIBW_SKIP: "*-win32 *-manylinux_i686 pp*"
# Pure Python meta-package # Pure Python meta-package
- uses: actions/upload-artifact@v3 - uses: actions/upload-artifact@v4
with: with:
name: cibw-wheels-${{ matrix.os }} name: cibw-wheels-${{ matrix.os }}
path: ./wheelhouse/*.whl path: ./wheelhouse/*.whl

View File

@@ -13,6 +13,7 @@ jobs:
build: build:
name: Build ${{ matrix.os }} Python ${{ matrix.python }} name: Build ${{ matrix.os }} Python ${{ matrix.python }}
strategy: strategy:
fail-fast: false
matrix: matrix:
include: include:
- os: ubuntu-latest - os: ubuntu-latest
@@ -43,15 +44,38 @@ jobs:
container: ${{ matrix.container }} container: ${{ matrix.container }}
steps: steps:
# Use v3 for manylinux2014 compatibility (Node.js 16 instead of 20) # For manylinux2014 compatibility, we'll handle checkout differently
- uses: actions/checkout@v3 - uses: actions/checkout@v4
if: matrix.container == ''
with: with:
ref: ${{ inputs.ref }} ref: ${{ inputs.ref }}
submodules: recursive submodules: recursive
# Manual checkout for containers to avoid Node.js compatibility issues
- name: Manual checkout in container
if: matrix.container != ''
run: |
# Install git if not available
yum install -y git || true
# Clone the repository manually in the container
git init
git remote add origin https://github.com/${GITHUB_REPOSITORY}.git
# Fetch the appropriate ref
if [ -n "${{ inputs.ref }}" ]; then
git fetch --depth=1 origin ${{ inputs.ref }}
else
git fetch --depth=1 origin ${GITHUB_SHA}
fi
git checkout FETCH_HEAD
# Initialize submodules
git submodule update --init --recursive
- name: Setup Python (macOS and regular Ubuntu) - name: Setup Python (macOS and regular Ubuntu)
if: matrix.container == '' if: matrix.container == ''
uses: actions/setup-python@v4 # v4 for better compatibility uses: actions/setup-python@v5
with: with:
python-version: ${{ matrix.python }} python-version: ${{ matrix.python }}
@@ -224,7 +248,7 @@ jobs:
find packages/*/dist -name "*.whl" -o -name "*.tar.gz" | sort find packages/*/dist -name "*.whl" -o -name "*.tar.gz" | sort
- name: Upload artifacts - name: Upload artifacts
uses: actions/upload-artifact@v3 # v3 for manylinux2014 compatibility uses: actions/upload-artifact@v4
with: with:
name: packages-${{ matrix.os }}-py${{ matrix.python }} name: packages-${{ matrix.os }}-py${{ matrix.python }}${{ matrix.container && '-manylinux' || '' }}
path: packages/*/dist/ path: packages/*/dist/

View File

@@ -23,7 +23,7 @@ jobs:
commit-sha: ${{ steps.push.outputs.commit-sha }} commit-sha: ${{ steps.push.outputs.commit-sha }}
steps: steps:
- uses: actions/checkout@v3 # Compatibility with manylinux2014 - uses: actions/checkout@v4
- name: Validate version - name: Validate version
run: | run: |
@@ -72,12 +72,12 @@ jobs:
contents: write contents: write
steps: steps:
- uses: actions/checkout@v3 # Consistency with build workflow - uses: actions/checkout@v4
with: with:
ref: ${{ needs.update-version.outputs.commit-sha }} ref: ${{ needs.update-version.outputs.commit-sha }}
- name: Download all artifacts - name: Download all artifacts
uses: actions/download-artifact@v3 # Match upload-artifact version uses: actions/download-artifact@v4
with: with:
path: dist-artifacts path: dist-artifacts