Skip to content

Commit

Permalink
Updated Github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
arjanz committed Mar 21, 2024
1 parent e6e36e8 commit 9c474dd
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 116 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -176,4 +176,17 @@ jobs:
name: wheels
path: dist

build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Build sdist
run: pipx run build --sdist

- uses: actions/upload-artifact@v4
with:
name: wheels
path: dist/*.tar.gz

145 changes: 80 additions & 65 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: macos-latest
strategy:
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12' ]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
Expand All @@ -18,7 +18,7 @@ jobs:
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
toolchain: nightly-2024-02-04
target: aarch64-apple-darwin
profile: minimal
default: true
Expand All @@ -28,37 +28,31 @@ jobs:
uses: messense/maturin-action@v1
with:
target: x86_64
rust-toolchain: nightly
args: -i python --release --out dist --no-sdist
rust-toolchain: nightly-2024-02-04
args: -i python --release --out dist
- name: Install built wheel - x86_64
run: |
pip install py-sr25519-bindings --no-index --find-links dist --force-reinstall
- name: Build wheels - universal2
if: ${{ matrix.python-version != '3.7' }}
uses: messense/maturin-action@v1
with:
args: -i python --release --universal2 --out dist --no-sdist
rust-toolchain: nightly
args: -i python --release --universal2 --out dist
rust-toolchain: nightly-2024-02-04
- name: Install built wheel - universal2
if: ${{ matrix.python-version != '3.7' }}
run: |
pip install py-sr25519-bindings --no-index --find-links dist --force-reinstall
- name: Python UnitTest
run: |
pip install -r requirements.txt
pip install pytest
pytest tests.py
- name: Upload wheels
uses: actions/upload-artifact@v2
with:
name: wheels
path: dist

windows:
runs-on: windows-latest
strategy:
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12' ]
target: [x64, x86]
steps:
- uses: actions/checkout@v2
Expand All @@ -71,7 +65,7 @@ jobs:
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
toolchain: nightly-2024-02-04
profile: minimal
default: true
- name: Build
Expand All @@ -81,16 +75,11 @@ jobs:
uses: messense/maturin-action@v1
with:
target: ${{ matrix.target }}
args: -i python --release --out dist --no-sdist
rust-toolchain: nightly
args: -i python --release --out dist
rust-toolchain: nightly-2024-02-04
- name: Install built wheel
run: |
pip install py-sr25519-bindings --no-index --find-links dist --force-reinstall
- name: Python UnitTest
run: |
pip install -r requirements.txt
pip install pytest
pytest tests.py
- name: Upload wheels
uses: actions/upload-artifact@v2
with:
Expand All @@ -101,14 +90,14 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12' ]
target: [x86_64, i686]
steps:
- uses: actions/checkout@v2
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
toolchain: nightly-2024-02-04
profile: minimal
default: true
- name: Build
Expand All @@ -120,16 +109,9 @@ jobs:
uses: messense/maturin-action@v1
with:
target: ${{ matrix.target }}
rust-toolchain: nightly
rust-toolchain: nightly-2024-02-04
manylinux: auto
args: -i python${{ matrix.python-version }} --release --out dist --no-sdist
- name: Python UnitTest
if: matrix.target == 'x86_64'
run: |
pip install py-sr25519-bindings --no-index --find-links dist --force-reinstall
pip install -r requirements.txt
pip install pytest
pytest tests.py
args: -i python${{ matrix.python-version }} --release --out dist
- name: Upload wheels
uses: actions/upload-artifact@v2
with:
Expand All @@ -142,17 +124,48 @@ jobs:

env:
CIBW_BUILD_VERBOSITY: 1
CIBW_BEFORE_ALL_LINUX: "curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly -y"
CIBW_BEFORE_ALL_LINUX: "curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly-2024-02-04 -y"
CIBW_ARCHS_LINUX: "auto64"
CIBW_ENVIRONMENT: 'PATH="$PATH:$HOME/.cargo/bin"'
CIBW_BUILD: "*-musllinux_x86_64"
CIBW_SKIP: "cp27-* cp34-* cp35-* "
CIBW_SKIP: "cp27-* cp34-* cp35-* cp36-*"

steps:
- uses: actions/checkout@v3

- name: Build wheels
uses: pypa/cibuildwheel@v2.9.0
with:
output-dir: dist


- uses: actions/upload-artifact@v3
with:
name: wheels
path: dist

aarch64_wheels:
name: Build wheels for aarch64 linux
runs-on: ubuntu-latest

env:
CIBW_BUILD_VERBOSITY: 1
CIBW_BEFORE_ALL_LINUX: "curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly-2024-02-04 -y"
CIBW_ARCHS_LINUX: "aarch64"
CIBW_ENVIRONMENT: 'PATH="$PATH:$HOME/.cargo/bin"'
CIBW_BUILD: "*-musllinux_aarch64 *-manylinux_aarch64"
CIBW_SKIP: "cp27-* cp34-* cp35-* cp36-*"

steps:
- uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: arm64

- name: Build wheels
uses: pypa/cibuildwheel@v2.11.2
uses: pypa/cibuildwheel@v2.9.0
with:
output-dir: dist

Expand All @@ -162,34 +175,36 @@ jobs:
name: wheels
path: dist

# aarch64_wheels:
# name: Build wheels for aarch64 linux
# runs-on: ubuntu-latest
#
# env:
# CIBW_BUILD_VERBOSITY: 1
# CIBW_BEFORE_ALL_LINUX: "curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly -y"
# CIBW_ARCHS_LINUX: "aarch64"
# CIBW_ENVIRONMENT: 'PATH="$PATH:$HOME/.cargo/bin"'
# CIBW_BUILD: "*-musllinux_aarch64 *-manylinux_aarch64"
# CIBW_SKIP: "cp27-* cp34-* cp35-* "
#
# steps:
# - uses: actions/checkout@v3
#
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v2
# with:
# platforms: arm64
#
# - name: Build wheels
# uses: pypa/cibuildwheel@v2.11.2
# with:
# output-dir: dist
#
#
# - uses: actions/upload-artifact@v3
# with:
# name: wheels
# path: dist
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Build sdist
run: pipx run build --sdist

- uses: actions/upload-artifact@v4
with:
name: wheels
path: dist/*.tar.gz

release:
name: Release
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/')"
needs: [ macos, windows, linux, muslwheels_x86, aarch64_wheels, build_sdist]
steps:
- uses: actions/download-artifact@v2
with:
name: wheels
- uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Publish to PyPi
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
pip install --upgrade twine
twine upload --skip-existing *
51 changes: 0 additions & 51 deletions .github/workflows/wheels.yml

This file was deleted.

0 comments on commit 9c474dd

Please sign in to comment.