Improves build and release scripts

pull/190/head
Tpt 3 years ago
parent 54c6652ea5
commit a6a51cad01
  1. 103
      .github/workflows/artifacts.yml
  2. 8
      .github/workflows/manylinux_build.sh
  3. 99
      .github/workflows/release.yml
  4. 53
      .github/workflows/tests.yml

@ -6,7 +6,7 @@ on:
- master - master
jobs: jobs:
python: python_doc:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
@ -38,6 +38,104 @@ jobs:
git push git push
working-directory: ./website working-directory: ./website
binary_linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- run: cargo build --release
working-directory: ./server
- uses: actions/upload-artifact@v2
with:
name: oxigraph_server_x86_64_linux_gnu
path: target/release/oxigraph_server
binary_mac:
runs-on: macos-latest
env:
DEVELOPER_DIR: '/Applications/Xcode.app/Contents/Developer'
SDKROOT: '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk'
MACOSX_DEPLOYMENT_TARGET: '10.9'
steps:
- uses: actions/checkout@v2
with:
submodules: true
- run: rustup update
- run: cargo build --release
working-directory: ./server
- uses: actions/upload-artifact@v2
with:
name: oxigraph_server_x86_64_apple
path: target/release/oxigraph_server
binary_windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- run: rustup update
- run: Remove-Item -LiteralPath "C:\msys64\" -Force -Recurse
- run: cargo build --release
working-directory: ./server
- uses: actions/upload-artifact@v2
with:
name: oxigraph_server_x86_64_windows_msvc
path: target/release/oxigraph_server.exe
wheel_linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- run: sed 's/%arch%/x86_64/g' .github/workflows/manylinux_build.sh > .github/workflows/manylinux_build_script.sh
- run: docker run -v "$(pwd)":/workdir --platform linux/x86_64 quay.io/pypa/manylinux2014_x86_64 /bin/bash /workdir/.github/workflows/manylinux_build_script.sh
- uses: actions/upload-artifact@v2
with:
name: pyoxigraph_x86_64_linux
path: target/wheels/*.whl
wheel_mac:
runs-on: macos-latest
env:
DEVELOPER_DIR: '/Applications/Xcode.app/Contents/Developer'
SDKROOT: '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk'
MACOSX_DEPLOYMENT_TARGET: '10.9'
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: actions/setup-python@v2
with:
python-version: 3.7
- run: rustup update && rustup target add aarch64-apple-darwin
- run: pip install maturin
- run: maturin build --release -m python/Cargo.toml --universal2
- uses: actions/upload-artifact@v2
with:
name: pyoxigraph_wheel_universal2_mac
path: target/wheels/*.whl
wheel_windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: actions/setup-python@v2
with:
python-version: 3.7
- run: rustup update
- run: Remove-Item -LiteralPath "C:\msys64\" -Force -Recurse
- run: pip install maturin
- run: maturin build --release -m python/Cargo.toml
- uses: actions/upload-artifact@v2
with:
name: pyoxigraph_wheel_x86_64_windows
path: target/wheels/*.whl
docker: docker:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
@ -45,8 +143,7 @@ jobs:
with: with:
submodules: 'recursive' submodules: 'recursive'
- uses: docker/setup-buildx-action@v1 - uses: docker/setup-buildx-action@v1
- name: Login to GitHub Container Registry - uses: docker/login-action@v1
uses: docker/login-action@v1
with: with:
registry: ghcr.io registry: ghcr.io
username: ${{github.actor}} username: ${{github.actor}}

@ -0,0 +1,8 @@
cd /workdir
yum -y install centos-release-scl-rh
yum -y install llvm-toolset-7.0
source scl_source enable llvm-toolset-7.0
curl https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal
curl --verbose -L "https://github.com/PyO3/maturin/releases/latest/download/maturin-%arch%-unknown-linux-musl.tar.gz" | tar -xz -C /usr/local/bin
export PATH="${PATH}:/root/.cargo/bin:/opt/python/cp37-cp37m/bin:/opt/python/cp38-cp38/bin:/opt/python/cp39-cp39/bin:/opt/python/cp310-cp310/bin"
maturin build --release --no-sdist -m python/Cargo.toml

@ -18,13 +18,11 @@ jobs:
images: | images: |
${{ github.repository }} ${{ github.repository }}
ghcr.io/${{ github.repository }} ghcr.io/${{ github.repository }}
- name: Login to DockerHub - uses: docker/login-action@v1
uses: docker/login-action@v1
with: with:
username: ${{ secrets.DOCKER_USERNAME }} username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }} password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to GitHub Container Registry - uses: docker/login-action@v1
uses: docker/login-action@v1
with: with:
registry: ghcr.io registry: ghcr.io
username: ${{github.actor}} username: ${{github.actor}}
@ -40,7 +38,7 @@ jobs:
cache-from: type=gha cache-from: type=gha
cache-to: type=gha,mode=max cache-to: type=gha,mode=max
publish_rocksdb_crate: publish_crates:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
@ -52,72 +50,64 @@ jobs:
CRATES_IO_TOKEN: ${{ secrets.CRATES_IO_TOKEN }} CRATES_IO_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
- run: cargo publish - run: cargo publish
working-directory: ./rocksdb-sys working-directory: ./rocksdb-sys
- run: cargo publish
publish_lib_crate: working-directory: ./lib/oxrdf
runs-on: ubuntu-latest - run: cargo publish
needs: publish_rocksdb_crate working-directory: ./lib/sparesults
steps: - run: cargo publish
- uses: actions/checkout@v2 working-directory: ./lib/spargebra
with:
submodules: true
- run: rustup update
- run: cargo login $CRATES_IO_TOKEN
env:
CRATES_IO_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
- run: cargo publish - run: cargo publish
working-directory: ./lib working-directory: ./lib
publish_server_crate:
runs-on: ubuntu-latest
needs: publish_lib_crate
steps:
- uses: actions/checkout@v2
with:
submodules: true
- run: rustup update
- run: cargo login $CRATES_IO_TOKEN
env:
CRATES_IO_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
- run: cargo publish - run: cargo publish
working-directory: ./server working-directory: ./server
python_wheel_linux: publish_pypi_linux:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: publish_lib_crate needs: publish_lib_crates
strategy:
matrix:
architecture: [ "x86_64", "aarch64" ]
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
with: with:
submodules: true submodules: true
- run: sed -i 's/path="..\/lib", //g' python/Cargo.toml - run: sed -i 's/path="..\/lib", //g' python/Cargo.toml
- uses: messense/maturin-action@v1 - run: sed 's/%arch%/${{ matrix.architecture }}/g' .github/workflows/manylinux_build.sh > .github/workflows/manylinux_build_script.sh
- run: docker run -v "$(pwd)":/workdir --platform linux/${{ matrix.architecture }} quay.io/pypa/manylinux2014_${{ matrix.architecture }} /bin/bash /workdir/.github/workflows/manylinux_build_script.sh
- uses: pypa/gh-action-pypi-publish@release/v1
with: with:
manylinux: 2014 user: __token__
container: messense/manylinux2014-cross:x86_64 password: ${{ secrets.PYPI_PASSWORD }}
command: publish packages_dir: target/wheels
args: -m python/Cargo.toml --cargo-extra-args="--no-default-features --features vendored" --no-sdist -u __token__ -p ${{ secrets.PYPI_PASSWORD }}
publish_pypi_mac: publish_pypi_mac:
runs-on: macos-latest runs-on: macos-latest
needs: publish_lib_crate needs: publish_lib_crates
env:
DEVELOPER_DIR: '/Applications/Xcode.app/Contents/Developer'
SDKROOT: '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk'
MACOSX_DEPLOYMENT_TARGET: '10.9'
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
with: with:
submodules: true submodules: true
- uses: messense/maturin-action@v1 - uses: actions/setup-python@v2
with: with:
command: publish python-version: 3.7
args: -m python/Cargo.toml --universal2 -u __token__ -p ${{ secrets.PYPI_PASSWORD }} - run: rustup update && rustup target add aarch64-apple-darwin
- uses: messense/maturin-action@v1 - run: pip install maturin
- run: sed -i 's/path="..\/lib", //g' python/Cargo.toml
- run: maturin build --release -m python/Cargo.toml --universal2
- run: maturin build --release --no-sdist -m python/Cargo.toml
- uses: pypa/gh-action-pypi-publish@release/v1
with: with:
command: publish user: __token__
args: -m python/Cargo.toml --no-sdist -u __token__ -p ${{ secrets.PYPI_PASSWORD }} password: ${{ secrets.PYPI_PASSWORD }}
packages_dir: target/wheels
python_wheel_windows: publish_pypi_windows:
runs-on: windows-latest runs-on: windows-latest
needs: publish_lib_crate needs: publish_lib_crates
strategy:
matrix:
architecture: ["x86", "x64"]
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
with: with:
@ -125,13 +115,16 @@ jobs:
- uses: actions/setup-python@v2 - uses: actions/setup-python@v2
with: with:
python-version: 3.7 python-version: 3.7
architecture: ${{ matrix.architecture }} - run: rustup update
- run: pip install maturin
- run: Remove-Item -LiteralPath "C:\msys64\" -Force -Recurse - run: Remove-Item -LiteralPath "C:\msys64\" -Force -Recurse
- uses: messense/maturin-action@v1 - run: sed -i 's/path="..\/lib", //g' python/Cargo.toml
- run: maturin build --release --no-sdist -m python/Cargo.toml
- uses: pypa/gh-action-pypi-publish@release/v1
with: with:
command: publish user: __token__
target: ${{ matrix.architecture }} password: ${{ secrets.PYPI_PASSWORD }}
args: -m python/Cargo.toml --no-sdist -u __token__ -p ${{ secrets.PYPI_PASSWORD }} packages_dir: target/wheels
publish_npm: publish_npm:
runs-on: ubuntu-latest runs-on: ubuntu-latest

@ -99,56 +99,3 @@ jobs:
working-directory: ./python/docs working-directory: ./python/docs
- run: source ../venv/bin/activate && sphinx-build -M html . build - run: source ../venv/bin/activate && sphinx-build -M html . build
working-directory: ./python/docs working-directory: ./python/docs
python_wheel_linux:
runs-on: ubuntu-latest
needs: python
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: messense/maturin-action@v1
with:
manylinux: 2014
container: messense/manylinux2014-cross:x86_64
command: build
args: -m python/Cargo.toml
- run: pip install pyoxigraph --no-index --find-links ../../target/wheels && python -m unittest
working-directory: ./python/tests
python_wheel_mac:
runs-on: macos-latest
needs: python
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: messense/maturin-action@v1
with:
command: build
args: -m python/Cargo.toml --universal2
- run: pip install pyoxigraph --no-index --find-links ../../target/wheels && python -m unittest
working-directory: ./python/tests
python_wheel_windows:
runs-on: windows-latest
needs: python
strategy:
matrix:
architecture: ["x86", "x64"]
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: actions/setup-python@v2
with:
python-version: 3.7
architecture: ${{ matrix.architecture }}
- run: Remove-Item -LiteralPath "C:\msys64\" -Force -Recurse
- uses: messense/maturin-action@v1
with:
command: build
target: ${{ matrix.architecture }}
args: -m python/Cargo.toml
- run: pip install pyoxigraph --no-index --find-links ../../target/wheels && python -m unittest
working-directory: ./python/tests

Loading…
Cancel
Save