v0.3.0 #52
Workflow file for this run
This file contains hidden or 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
# test, build, and release python wheels | |
name: wheels | |
# trigger whenever a release is published | |
on: | |
release: | |
types: [published] | |
# run tests, build, upload | |
jobs: | |
call-tests: | |
uses: nrel/altrios/.github/workflows/py-tests.yaml@main | |
build: | |
name: build py3.${{ matrix.python-version }} on ${{ matrix.platform || matrix.os }} | |
needs: call-tests | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu | |
- macos | |
- windows | |
python-version: | |
- "10" | |
- "11" | |
include: | |
- os: ubuntu | |
platform: linux | |
- os: windows | |
ls: dir | |
runs-on: ${{ format('{0}-latest', matrix.os) }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: set up python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11" | |
- name: set up rust | |
if: matrix.os != 'ubuntu' | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
- run: rustup target add aarch64-apple-darwin x86_64-apple-darwin | |
if: matrix.os == 'macos' | |
- name: install python dependencies | |
run: pip install -U maturin wheel twine cibuildwheel | |
- name: build sdist | |
if: matrix.os == 'ubuntu' && matrix.python-version == '10' | |
run: | | |
pip install -U maturin | |
maturin build --sdist --out dist/ | |
- name: build ${{ matrix.platform || matrix.os }} binaries | |
run: cibuildwheel --output-dir dist | |
env: | |
MACOSX_DEPLOYMENT_TARGET: 10.12 | |
CIBW_BUILD: "cp3${{ matrix.python-version }}-*" | |
CIBW_SKIP: "*-win32 *-musllinux* *i686 *ppc64le *s390x *aarch64" | |
CIBW_PLATFORM: ${{ matrix.platform || matrix.os }} | |
CIBW_ENVIRONMENT: 'PATH="$HOME/.cargo/bin:$PATH"' | |
CIBW_ENVIRONMENT_WINDOWS: 'PATH="$UserProfile\.cargo\bin;$PATH"' | |
CIBW_ARCHS_MACOS: "universal2" | |
CIBW_BEFORE_BUILD: > | |
pip install -U maturin && | |
rustup default stable && | |
rustup show | |
CIBW_BEFORE_BUILD_LINUX: > | |
pip install -U setuptools-rust && | |
curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain=stable --profile=minimal -y && | |
rustup show | |
- name: upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: "wheel-${{ matrix.os }}-py${{ matrix.python-version }}" | |
path: dist | |
upload: | |
if: github.repository == 'nrel/altrios' || github.repository == 'nrel/altrios-private' | |
needs: build | |
runs-on: ubuntu-latest | |
environment: | |
name: pypi | |
url: https://pypi.org/p/altrios | |
permissions: | |
id-token: write | |
steps: | |
- name: Download all workflow run artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
pattern: wheel* | |
path: dist/ | |
merge-multiple: true | |
- name: publish package | |
uses: pypa/gh-action-pypi-publish@release/v1 |