ci: give correct path on windows #7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish | ||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: [ 'main' ] | ||
tags: [ 'v**' ] | ||
pull_request: | ||
branches: [ 'main' ] | ||
schedule: | ||
- cron: '30 12 * * 0' | ||
jobs: | ||
build_sdist: | ||
name: Build sdist | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Build sdist | ||
run: | | ||
pipx run build --sdist --outdir dist python | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: cibw-sdist | ||
path: dist/*.tar.gz | ||
build_wheels: | ||
name: Build wheels (${{ matrix.os }}-${{ matrix.architecture }}) | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
architecture: [x86-64, aarch64] | ||
exclude: | ||
- os: windows-latest | ||
architecture: aarch64 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.10' | ||
- name: Set Rust target (aarch64) | ||
if: matrix.architecture == 'aarch64' | ||
id: target | ||
run: | | ||
TARGET=$( | ||
if [[ "${{ matrix.os }}" == "macos-latest" ]]; then | ||
echo "aarch64-apple-darwin"; | ||
else | ||
echo "aarch64-unknown-linux-gnu"; | ||
fi | ||
) | ||
echo "target=$TARGET" >> $GITHUB_OUTPUT | ||
- name: Build wheels | ||
uses: PyO3/maturin-action@v1 | ||
with: | ||
command: build | ||
target: ${{ steps.target.outputs.target }} | ||
args: --release --out dist -m python/Cargo.toml | ||
manylinux: ${{ matrix.architecture == 'aarch64' && '2_24' || 'auto' }} | ||
- name: Test wheels | ||
if: matrix.architecture == 'x86-64' && matrix.os != "windows-latest" | ||
Check failure on line 72 in .github/workflows/wheels.yml
|
||
run: | | ||
python -m pip install --force-reinstall --verbose 'dist/*.whl' | ||
python -c 'import pymittagleffler' | ||
- name: Test wheels | ||
if: matrix.architecture == 'x86-64' && matrix.os == "windows-latest" | ||
run: | | ||
python -m pip install --force-reinstall --verbose dist\*.whl | ||
python -c 'import pymittagleffler' | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: cibw-wheels-${{ matrix.os }}-${{ matrix.architecture}}-${{ strategy.job-index }} | ||
path: dist/*.whl | ||
publish: | ||
needs: [ 'build_sdist', 'build_wheels' ] | ||
runs-on: ubuntu-latest | ||
environment: pypi | ||
permissions: | ||
contents: write | ||
id-token: write | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | ||
defaults: | ||
run: | ||
working-directory: python | ||
steps: | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
pattern: cibw-* | ||
path: dist | ||
merge-multiple: true | ||
- uses: pypa/gh-action-pypi-publish@release/v1 |