Skip to content

Commit

Permalink
Update workflows (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
prehner authored Jul 14, 2024
1 parent c97f084 commit c732619
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 117 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ name: Deploy Documentation
on:
push:
branches: [master]
pull_request:
branches: [master]

env:
CARGO_TERM_COLOR: always
Expand Down
123 changes: 41 additions & 82 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,89 +26,91 @@ jobs:
linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Build Wheels
uses: messense/maturin-action@v1
uses: PyO3/maturin-action@v1
with:
manylinux: auto
command: build
args: --release --out dist
- name: Upload wheels
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: dist
name: wheel-linux-x86_64
path: dist

macos:
runs-on: macos-latest
macos-x86_64:
runs-on: macos-12
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.9
architecture: x64
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
default: true
- name: Build wheels - x86_64
uses: messense/maturin-action@v1
uses: PyO3/maturin-action@v1
with:
target: x86_64
args: --release --out dist
- name: Build wheels - universal2
uses: messense/maturin-action@v1
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheel-macos-x86_64
path: dist
macos-aarch64:
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
args: --release --universal2 --out dist
python-version: 3.9
architecture: arm64
- name: Build wheels - aarch64
uses: PyO3/maturin-action@v1
with:
target: aarch64
args: --release --out dist
- name: Upload wheels
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: dist
name: wheel-aarch64-apple-darwin
path: dist

windows:
runs-on: windows-latest
strategy:
matrix:
target: [x64, x86]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.9
architecture: ${{ matrix.target }}
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
default: true
- name: Build wheels
uses: messense/maturin-action@v1
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist
- name: Upload wheels
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: dist
name: wheel-${{ matrix.target }}
path: dist

deploy-pypi:
name: Publish wheels to PyPI and TestPyPI
runs-on: ubuntu-latest
needs: [linux, windows, macos]
needs: [linux, windows, macos-x86_64, macos-aarch64]
steps:
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v4
with:
name: dist
path: dist
- uses: actions/setup-python@v2
pattern: wheel-*
path: wheels
merge-multiple: true
- uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Publish to PyPi
Expand All @@ -117,47 +119,4 @@ jobs:
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
pip install --upgrade twine
twine upload --skip-existing dist/*
build-documentation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install python dependencies
run: |
pip install sphinx sphinx-rtd-theme
- name: Build Wheels
uses: messense/maturin-action@v1
with:
manylinux: auto
command: build
args: --release --out dist
- name: Install module
run: |
pip install num_dual --no-index --find-links dist --force-reinstall
- name: Build documentation
run: sphinx-build docs/ public/ -b html
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: documentation
path: public

release-documentation:
needs: [build-documentation]
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v1
with:
name: documentation
path: public
- name: Deploy documentation to gh-pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
twine upload --skip-existing wheels/*
66 changes: 34 additions & 32 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,73 +8,75 @@ jobs:
linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Build Wheels
uses: messense/maturin-action@main
uses: PyO3/maturin-action@v1
with:
manylinux: auto
command: build
args: --release --out dist
- name: Upload wheels
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: dist
name: wheel-linux-x86_64
path: dist
macos:
runs-on: macos-latest
macos-x86_64:
runs-on: macos-12
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.9
architecture: x64
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
default: true
- name: Build wheels - x86_64
uses: messense/maturin-action@main
uses: PyO3/maturin-action@v1
with:
target: x86_64
args: --release --out dist
- name: Build wheels - universal2
uses: messense/maturin-action@main
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheel-macos-x86_64
path: dist
macos-aarch64:
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
args: --release --universal2 --out dist
python-version: 3.9
architecture: arm64
- name: Build wheels - aarch64
uses: PyO3/maturin-action@v1
with:
target: aarch64
args: --release --out dist
- name: Upload wheels
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: dist
name: wheel-aarch64-apple-darwin
path: dist
windows:
runs-on: windows-latest
strategy:
matrix:
target: [x64, x86]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.9
architecture: ${{ matrix.target }}
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
default: true
- name: Build wheels
uses: messense/maturin-action@main
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist
- name: Upload wheels
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: dist
name: wheel-${{ matrix.target }}
path: dist
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["maturin>=0.13,<0.14"]
requires = ["maturin>=1.0,<2.0"]
build-backend = "maturin"

[tool.maturin]
Expand Down

0 comments on commit c732619

Please sign in to comment.