ci: split pypi from cargo workflows

This commit is contained in:
William Ballenthin 2021-11-15 13:17:23 -07:00
parent f0aa377860
commit 917580033b
3 changed files with 48 additions and 161 deletions

View file

@ -1,158 +0,0 @@
on:
release:
types: [created, edited]
name: publish
jobs:
crate:
name: publish to crates.io
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: login
run: cargo login ${CARGO_TOKEN}
env:
CARGO_TOKEN: ${{ secrets.CARGO_TOKEN }}
- name: publish flirt
run: |
cd flirt
cargo publish
cd ..
- name: publish core
run: |
sleep 60 # give a moment for crates.io to propagate
cd core
cargo publish
cd ..
- name: publish bin
run: |
sleep 60 # give a moment for crates.io to propagate
cd bin
cargo publish
cd ..
whl-other:
name: build python wheels for ${{ matrix.os }}
needs: [crate]
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: windows-latest
plat: win_amd64
- os: macos-latest
plat: macosx_x86_64
steps:
- uses: actions/checkout@v2
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
- uses: actions/setup-python@v1
with:
python-version: "3.6"
- uses: actions/setup-python@v1
with:
python-version: "3.7"
- uses: actions/setup-python@v1
with:
python-version: "3.8"
- uses: actions/setup-python@v1
with:
python-version: "3.9"
- uses: actions/setup-python@v1
with:
python-version: "3.10"
- name : invoke maturin pylancelot
run: |
pip install maturin
maturin build --release --strip --manifest-path=./pylancelot/Cargo.toml
ls -R target/wheels/
- name : invoke maturin pyflirt
run: |
pip install maturin
maturin build --release --strip --manifest-path=./pyflirt/Cargo.toml
ls -R target/wheels/
- uses: actions/upload-artifact@v2
with:
name: pylancelot-${{ matrix.plat }}-whl
path: target/wheels/*.whl
- uses: actions/upload-artifact@v2
with:
name: python-flirt-${{ matrix.plat }}-whl
path: target/wheels/*.whl
- name: install twine
run: |
python -m pip install --upgrade pip setuptools twine
- name: publish to pypi
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
twine upload --skip-existing target/wheels/*
whl-linux:
name: build python wheels for manylinux2010
needs: [crate]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: "3.8"
- name: build wheels pylancelot
# see Dockerfile for this image
run: |
docker run --rm -v $(pwd):/io --workdir=/io williballenthin/maturin build --release --strip --manifest-path=./pylancelot/Cargo.toml --manylinux 2010
- name: build wheels pyflirt
run: |
docker run --rm -v $(pwd):/io --workdir=/io williballenthin/maturin build --release --strip --manifest-path=./pyflirt/Cargo.toml --manylinux 2010
- uses: actions/upload-artifact@v2
with:
name: pylancelot-manylinux2010_x86_64-whl
path: target/wheels/*.whl
- uses: actions/upload-artifact@v2
with:
name: python-flirt-manylinux2010_x86_64-whl
path: target/wheels/*.whl
- name: install twine
run: |
python -m pip install --upgrade pip setuptools twine
- name: publish to pypi
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
twine upload --skip-existing target/wheels/*

43
.github/workflows/publish-cargo.yaml vendored Normal file
View file

@ -0,0 +1,43 @@
on:
release:
types: [created, edited]
name: publish cargo
jobs:
crate:
name: publish to crates.io
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: login
run: cargo login ${CARGO_TOKEN}
env:
CARGO_TOKEN: ${{ secrets.CARGO_TOKEN }}
- name: publish flirt
run: |
cd flirt
cargo publish
cd ..
- name: publish core
run: |
sleep 60 # give a moment for crates.io to propagate
cd core
cargo publish
cd ..
- name: publish bin
run: |
sleep 60 # give a moment for crates.io to propagate
cd bin
cargo publish
cd ..

View file

@ -1,6 +1,8 @@
on: [push, pull_request]
on:
release:
types: [created, edited]
name: bindings
name: publish pypi
jobs:
linux:
@ -74,7 +76,7 @@ jobs:
uses: actions/upload-artifact@v2
with:
name: wheels
path: dist
path: target/wheels/*.whl
windows:
runs-on: windows-latest