install rust before building wheels #6
Workflow file for this run
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
concurrency: ADO-twine | |
on: | |
workflow_dispatch: | |
push: | |
tags: "python-v*" | |
jobs: | |
python-checks: | |
uses: ./.github/workflows/python.yml | |
rust-checks: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.9 | |
- name: Test fizzbuzzo3 | |
run: cargo test --package fizzbuzzo3 | |
wheels: | |
name: Build wheels on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
# macos-13 is an intel runner, macos-14 is apple silicon | |
os: [ubuntu-latest, windows-latest, macos-13, macos-14] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build wheels | |
uses: pypa/[email protected] | |
env: | |
CIBW_CONFIG_SETTINGS: "--build-option=--py-limited-api=cp38" | |
CIBW_BEFORE_ALL_LINUX: "yum install -y rust cargo" | |
CIBW_BEFORE_ALL_MACOS: "brew install -y rust" | |
CIBW_BEFORE_ALL_WINDOWS: "choco install -y rust" | |
# with: | |
# package-dir: . | |
# output-dir: wheelhouse | |
# config-file: "{package}/pyproject.toml" | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} | |
path: ./wheelhouse/*.whl | |
sdist: | |
name: Make SDist | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build SDist | |
run: pipx run build --sdist | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: cibw-sdist | |
path: dist/*.tar.gz | |
publish: | |
environment: ADO-Packages | |
needs: [python-checks, rust-checks, wheels, sdist] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
pattern: cibw-* | |
path: dist | |
merge-multiple: true | |
- name: Install ADO tooling | |
run: python -m pip install keyring artifacts-keyring | |
- name: Upload to ADO | |
env: | |
TWINE_REPOSITORY_URL: https://pkgs.dev.azure.com/MusicalNinjas/FizzBuzz/_packaging/FizzBuzz/pypi/upload/ | |
TWINE_USERNAME: FizzBuzz | |
TWINE_PASSWORD: ${{ secrets.ADO_TOKEN }} | |
run: twine upload --non-interactive dist/* |