Browse Source

Merge pull request #30 from Vadiml1024/new-embed-libs

Intrgrate embedding of libarchive.so into the deploy workflow
test_fixup
Clifton Barnes 2 years ago
committed by GitHub
parent
commit
7d8b4997bb
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 79 additions and 13 deletions
  1. +43
    -13
      .github/workflows/deploy.yml
  2. +36
    -0
      build-libarchive-lib.sh

+ 43
- 13
.github/workflows/deploy.yml View File

@@ -3,24 +3,54 @@ on:
push:
tags:
- '*'
env:
libarchive_tag: v3.6.1

jobs:
deploy:
name: Deploy to PyPI
if: startsWith(github.ref, 'refs/tags')
build_wheels:
name: Build wheels
runs-on: ubuntu-latest
steps:
- name: Setup python
uses: actions/setup-python@v4
- uses: actions/checkout@v3
- name: Build wheels
uses: pypa/cibuildwheel@v2.9.0
env:
CIBW_ENVIRONMENT: INCLUDE=/usr/local/include LIBARCHIVE_PREFIX=/usr/local
CIBW_PYTHON_VERSIONS: 3.8,3.9,3.10
CIBW_BEFORE_ALL: bash -x build-libarchive-lib.sh centos ${{ env.libarchive_tag }}

- uses: actions/upload-artifact@v3
with:
python-version: '3.8'
path: ./wheelhouse/*.whl

- name: Check out code
uses: actions/checkout@v3
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Build the library
run: python3 setup.py sdist
- name: Build sdist
run: pipx run build --sdist

- uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
- uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz

upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
steps:
- uses: actions/download-artifact@v3
with:
# unpacks default artifact into dist/
# if `name: artifact` is omitted, the action will create extra parent dir
name: artifact
path: dist

- name: Deploy wheels to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}

+ 36
- 0
build-libarchive-lib.sh View File

@@ -0,0 +1,36 @@
#!/usr/bin/bash

function build_libarchive() {
tag=$1

dd=$PWD
cd /tmp
git clone https://github.com/libarchive/libarchive.git libarchive-src
cd libarchive-src; git checkout $tag
cd /tmp
mkdir build-libarchive; cd build-libarchive
cmake ../libarchive-src
make -j$(nproc); make install
cd $dd

}

function install_deps_centos() {
yum install -y epel-release libxml2-devel libzstd-devel xz-devel bzip2-devel
yum install -y libacl-devel lz4-devel e2fsprogs-devel libb2-devel lzo-devel openssl-devel
yum install -y librichacl-devel swig strace cmake
}

function install_deps_ubuntu() {
apt-get install -y libxml2-dev libzstd-dev xz-dev bzip2-dev
apt-get install -y libacl1-dev liblz4-dev libext2fs-dev libb2-dev lzo-dev libssl-dev
apt-get install -y swig strace cmake
}

os=$1
tag=$2
install_deps_$os
build_libarchive $tag


Loading…
Cancel
Save