ci: simplified workflows, disabled targets

This commit is contained in:
əlemi 2024-09-09 19:47:42 +02:00
parent 1541ede699
commit 05e8343641
Signed by: alemi
GPG key ID: A4895B84D311642C
3 changed files with 56 additions and 111 deletions

View file

@ -10,86 +10,29 @@ permissions:
contents: read contents: read
jobs: jobs:
linux: build:
runs-on: ${{ matrix.platform.runner }} runs-on: ${{ matrix.platform.runner }}
strategy: strategy:
matrix: matrix:
platform: platform:
- runner: ubuntu-latest - runner: ubuntu-latest
target: x64 target: linux-x64-gnu
#- runner: ubuntu-latest filename: libcodemp.so
# target: x86
#- runner: ubuntu-latest
# target: aarch64
#- runner: ubuntu-latest
# target: armv7
steps:
- uses: actions/checkout@v4
- run: rustup update stable && rustup default stable
- uses: arduino/setup-protoc@v3
- run: cargo build --release --features=lua
- uses: actions/upload-artifact@v4
with:
name: codemp_native-lua-linux-${{ matrix.platform.target }}-gnu.so # will this rename????
path: target/release/libcodemp.so
musllinux:
runs-on: ${{ matrix.platform.runner }}
strategy:
matrix:
platform:
#- runner: ubuntu-latest
# target: x86_64
#- runner: ubuntu-latest
# target: x86
- runner: ubuntu-latest
target: aarch64
#- runner: ubuntu-latest
# target: armv7
steps:
- uses: actions/checkout@v4
- run: rustup update stable && rustup default stable
- uses: arduino/setup-protoc@v3
- run: cargo build --release --features=lua
- uses: actions/upload-artifact@v4
with:
name: codemp_native-lua-linux-${{ matrix.platform.target }}-musl.so # will this rename????
path: target/release/libcodemp.so
windows:
runs-on: ${{ matrix.platform.runner }}
strategy:
matrix:
platform:
- runner: windows-latest - runner: windows-latest
target: x64 target: win32-x64
#- runner: windows-latest filename: codemp.dll
# target: x86
steps:
- uses: actions/checkout@v4
- run: rustup update stable && rustup default stable
- uses: arduino/setup-protoc@v3
- run: cargo build --release --features=lua
- uses: actions/upload-artifact@v4
with:
name: codemp_native-lua-windows-${{ matrix.platform.target }}.dll # will this rename????
path: target/release/codemp.dll
macos:
runs-on: ${{ matrix.platform.runner }}
strategy:
matrix:
platform:
#- runner: macos-12
# target: x64
- runner: macos-14 - runner: macos-14
target: aarch64 target: darwin-arm64
filename: codemp.dylib
#- runner: macos-12
# target: darwin-x64
# filename: codemp.dylib
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- run: rustup update stable && rustup default stable - uses: dtolnay/rust-toolchain@stable
- uses: arduino/setup-protoc@v3 - uses: arduino/setup-protoc@v3
- run: cargo build --release --features=lua - run: cargo build --release --features=lua
- uses: actions/upload-artifact@v4 - uses: actions/upload-artifact@v4
with: with:
name: codemp_native-lua-macos-${{ matrix.platform.target }}.dylib # will this rename???? name: codemp-lua-${{ matrix.platform.target }}
path: target/release/codemp.dylib path: target/release/libcodemp.so

View file

@ -46,42 +46,41 @@ jobs:
- name: Upload wheels - name: Upload wheels
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: wheels-linux-${{ matrix.platform.target }} name: codemp-py-linux-${{ matrix.platform.target }}
path: dist/py path: dist/py
musllinux: #musllinux:
runs-on: ${{ matrix.platform.runner }} # runs-on: ${{ matrix.platform.runner }}
strategy: # strategy:
matrix: # matrix:
platform: # platform:
#- runner: ubuntu-latest # #- runner: ubuntu-latest
# target: x86_64 # # target: x86_64
#- runner: ubuntu-latest # #- runner: ubuntu-latest
# target: x86 # # target: x86
- runner: ubuntu-latest # - runner: ubuntu-latest
target: aarch64 # target: aarch64
#- runner: ubuntu-latest # #- runner: ubuntu-latest
# target: armv7 # # target: armv7
steps: # steps:
- uses: actions/checkout@v4 # - uses: actions/checkout@v4
- uses: arduino/setup-protoc@v3 # - uses: arduino/setup-protoc@v3
- uses: actions/setup-python@v5 # - uses: actions/setup-python@v5
with: # with:
python-version: 3.x # python-version: 3.x
- name: Build wheels # - name: Build wheels
uses: PyO3/maturin-action@v1 # uses: PyO3/maturin-action@v1
with: # with:
working-directory: dist/py # working-directory: dist/py
target: ${{ matrix.platform.target }} # target: ${{ matrix.platform.target }}
container: 'off' # args: --release --out .
args: --release --out . # sccache: 'true'
sccache: 'true' # manylinux: musllinux_1_2 # TODO for manylinux it runs in a container without protoc!
manylinux: musllinux_1_2 # - name: Upload wheels
- name: Upload wheels # uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v4 # with:
with: # name: codemp-py-musllinux-${{ matrix.platform.target }}
name: wheels-musllinux-${{ matrix.platform.target }} # path: dist/py
path: dist/py
windows: windows:
runs-on: ${{ matrix.platform.runner }} runs-on: ${{ matrix.platform.runner }}
@ -110,7 +109,7 @@ jobs:
- name: Upload wheels - name: Upload wheels
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: wheels-windows-${{ matrix.platform.target }} name: codemp-py-windows-${{ matrix.platform.target }}
path: dist/py path: dist/py
macos: macos:
@ -139,7 +138,7 @@ jobs:
- name: Upload wheels - name: Upload wheels
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: wheels-macos-${{ matrix.platform.target }} name: codemp-py-macos-${{ matrix.platform.target }}
path: dist/py path: dist/py
sdist: sdist:
@ -155,20 +154,21 @@ jobs:
- name: Upload sdist - name: Upload sdist
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: wheels-sdist name: codemp-py-sdist
path: dist/py path: dist/py
release: release:
name: Release name: Release
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/')" if: "startsWith(github.ref, 'refs/tags/')"
needs: [linux, musllinux, windows, macos, sdist] needs: [linux, windows, macos, sdist]
steps: steps:
- uses: actions/download-artifact@v4 - uses: actions/download-artifact@v4
pattern: codemp-py-*
- name: Publish to PyPI - name: Publish to PyPI
uses: PyO3/maturin-action@v1 uses: PyO3/maturin-action@v1
env: env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }} MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
with: with:
command: upload command: upload
args: --non-interactive --skip-existing wheels-*/* args: --non-interactive --skip-existing codemp-py-*/*

View file

@ -31,7 +31,9 @@ jobs:
# TODO should re-enable future toolchains so we get warnings on breaking changes # TODO should re-enable future toolchains so we get warnings on breaking changes
steps: steps:
- uses: arduino/setup-protoc@v3 - uses: arduino/setup-protoc@v3
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }} - uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
- run: cargo build --verbose --features=${{ matrix.features }} - run: cargo build --verbose --features=${{ matrix.features }}
- run: cargo test --verbose --features=${{ matrix.features }} - run: cargo test --verbose --features=${{ matrix.features }}