Bump to version 0.4.0 (#41) #16
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
name: python-release | |
on: | |
push: | |
tags: | |
- 'v[0-9]+.[0-9]+.[0-9]+' | |
jobs: | |
validate-release-tag: | |
name: Validate git tag | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/v') | |
steps: | |
- uses: actions/checkout@v3 | |
- name: compare git tag with cargo metadata | |
run: | | |
PUSHED_TAG=${GITHUB_REF##*/} | |
CURR_VER=$( grep version python/Cargo.toml | head -n 1 | awk '{print $3}' | tr -d '"' ) | |
if [[ "${PUSHED_TAG}" != "v${CURR_VER}" ]]; then | |
echo "Cargo metadata has version set to ${CURR_VER}, but got pushed tag ${PUSHED_TAG}." | |
exit 1 | |
fi | |
linux: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
target: [x86_64, aarch64] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup QEMU | |
uses: docker/setup-qemu-action@v2 | |
if: ${{ matrix.target }} != 'x86_64' | |
- name: Build wheels | |
uses: PyO3/maturin-action@v1 | |
with: | |
target: ${{ matrix.target }} | |
args: --release --out dist --find-interpreter --manifest-path python/Cargo.toml | |
sccache: 'true' | |
container: quay.io/pypa/manylinux2014_${{ matrix.target }}:latest | |
docker-options: -e LD_LIBRARY_PATH=/opt/rh/llvm-toolset-7.0/root/usr/lib64 -e LLVM_CONFIG_PATH=/opt/rh/llvm-toolset-7.0/root/usr/bin/llvm-config | |
before-script-linux: | | |
yum install -y epel-release && yum install -y krb5-devel libgsasl-devel llvm-toolset-7.0-clang llvm-toolset-7.0-llvm-devel | |
- name: Upload wheels | |
uses: actions/upload-artifact@v3 | |
with: | |
name: wheels | |
path: dist | |
# windows: | |
# runs-on: windows-latest | |
# strategy: | |
# matrix: | |
# target: [x64, x86] | |
# steps: | |
# - uses: actions/checkout@v3 | |
# - uses: actions/setup-python@v4 | |
# with: | |
# python-version: '3.10' | |
# architecture: ${{ matrix.target }} | |
# - name: Build wheels | |
# uses: PyO3/maturin-action@v1 | |
# with: | |
# target: ${{ matrix.target }} | |
# args: --release --out dist --find-interpreter | |
# sccache: 'true' | |
# - name: Upload wheels | |
# uses: actions/upload-artifact@v3 | |
# with: | |
# name: wheels | |
# path: dist | |
macos: | |
runs-on: macos-latest | |
strategy: | |
matrix: | |
target: [x86_64, aarch64] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install native libs | |
run: | |
brew install krb5 gsasl | |
- name: Build wheels | |
uses: PyO3/maturin-action@v1 | |
with: | |
target: ${{ matrix.target }} | |
args: --release --out dist --find-interpreter --manifest-path python/Cargo.toml | |
sccache: 'true' | |
env: | |
BINDGEN_EXTRA_CLANG_ARGS: "-I/usr/local/include" | |
LIBRARY_PATH: /usr/local/lib | |
- name: Upload wheels | |
uses: actions/upload-artifact@v3 | |
with: | |
name: wheels | |
path: dist | |
sdist: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build sdist | |
uses: PyO3/maturin-action@v1 | |
with: | |
command: sdist | |
args: --out dist --manifest-path python/Cargo.toml | |
- name: Upload sdist | |
uses: actions/upload-artifact@v3 | |
with: | |
name: wheels | |
path: dist | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/v') | |
needs: [linux, macos, sdist] | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
name: wheels | |
- name: Publish to PyPI | |
uses: PyO3/maturin-action@v1 | |
env: | |
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }} | |
with: | |
command: upload | |
args: --skip-existing * |