Skip to content

Commit

Permalink
cicd test
Browse files Browse the repository at this point in the history
  • Loading branch information
bitjerry committed Apr 8, 2024
1 parent dce5fc5 commit 7aba4f7
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 58 deletions.
93 changes: 47 additions & 46 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ jobs:
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
apk add openssl-dev openssl-libs-static &&
mkdir -p /openssl/${{ matrix.os }}/${{ matrix.arch }}/include/openssl /openssl/${{ matrix.os }}/${{ matrix.arch }}/lib &&
cp -R /usr/lib/libcrypto.a /openssl/${{ matrix.os }}/${{ matrix.arch }}/lib &&
cp -R /usr/include/openssl /openssl/${{ matrix.os }}/${{ matrix.arch }}/include/openssl
mkdir -p /openssl/${{ matrix.os }}/${{ matrix.arch }}/include /openssl/${{ matrix.os }}/${{ matrix.arch }}/lib &&
cp -R /usr/lib/libcrypto.a /openssl/linux/${{ matrix.arch }}/lib &&
cp -R /usr/include/openssl /openssl/linux/${{ matrix.arch }}/include
shell: alpine.sh --root {0}

- name: Install Openssl On MacOS
Expand All @@ -104,25 +104,26 @@ jobs:
# if: ${{ steps.check_coverage_artifact.outputs.exists == 'false' }}
with:
name: openssl-dist
path: ${{ github.workspace }}/openssl
path: ./openssl


cache-openssl:
name: Cache Openssl
runs-on: ubuntu-latest
needs: [pre-deploy, build-openssl]
if: ${{ needs.pre-deploy.outputs.openssl-exist != 'true' }}
steps:
- name: Cache Openssl
uses: actions/cache@v4
id: cache
with:
path: /openssl
path: ./openssl
key: openssl-cache
- name: Download openssl
uses: actions/download-artifact@v3
with:
name: openssl-dist
path: /openssl
path: ./openssl


# build-tarball:
Expand Down Expand Up @@ -157,49 +158,49 @@ jobs:
# name: dist
# path: ./python/dist

# build-wheels:
# name: Build wheels on ${{ matrix.os }}
# runs-on: ${{ matrix.os }}
# needs: pre-openssl
# strategy:
# fail-fast: false
# matrix:
# os: [ windows-latest, macos-13, macos-14, ubuntu-latest ]
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# - name: Setup Python
# uses: actions/setup-python@v5
# with:
# python-version: 3.x
# - name: Restore cached openssl
# uses: actions/cache/restore@v4
# with:
# path: ${{ github.workspace }}/openssl/
# key: openssl-${{ matrix.os }}
build-wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
needs: [pre-openssl]
strategy:
fail-fast: false
matrix:
os: [ windows-latest, macos-13, macos-14, ubuntu-latest ]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Restore cached openssl
uses: actions/cache/restore@v4
with:
path: ./openssl
key: openssl-cache
# restore-keys: openssl-${{ matrix.os }}
## - name: Download openssl
## uses: actions/download-artifact@v3
## with:
## name: dist
## path: ./python/
# - name: Update pip, wheel, setuptools, build, twine, cibuildwheel
# run: |
# python -m pip install -U pip wheel setuptools build twine cibuildwheel
#
## Fucking cibuildwheel doesn't contain a real cross-compilation toolchain, at least Linux requires qemu
#
# - name: Build wheels
# run: |
# cd ./python &&
# python -m cibuildwheel --output-dir wheelhouse
# env:
# CIBW_ENVIRONMENT: SYSTEM_VERSION_COMPAT=0 _CROSS_COMPILE_FILE=./CrossCompile.json
# CIBW_TEST_COMMAND: python {project}/tests/test.py
# - uses: actions/upload-artifact@v3
# - name: Download openssl
# uses: actions/download-artifact@v3
# with:
# name: dist
# path: ./python/wheelhouse/*.whl
# path: ./python/
- name: Update pip, wheel, setuptools, build, twine, cibuildwheel
run: |
python -m pip install -U pip wheel setuptools build twine cibuildwheel
# Fucking cibuildwheel doesn't contain a real cross-compilation toolchain, at least Linux requires qemu

- name: Build wheels
run: |
cd ./python &&
python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_ENVIRONMENT: SYSTEM_VERSION_COMPAT=0 _CROSS_COMPILE_FILE=./CrossCompile.json
CIBW_TEST_COMMAND: python {project}/tests/test.py
- uses: actions/upload-artifact@v3
with:
name: dist
path: ./python/wheelhouse/*.whl

# deploy:
# name: Deploy
Expand Down
24 changes: 12 additions & 12 deletions python/CrossCompile.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,37 @@
"windows": {
"i686": {
"openssl_libraries": ["libcrypto32MT", "Crypt32", "ws2_32", "Advapi32", "User32"],
"openssl_include_dir": ["./openssl/i686/include"],
"openssl_library_dir": ["./openssl/i686/lib/VC/static"]
"openssl_include_dir": ["./openssl/win/i686/include"],
"openssl_library_dir": ["./openssl/win/i686/lib"]
},
"x86_64": {
"openssl_libraries": ["libcrypto64MT", "Crypt32", "ws2_32", "Advapi32", "User32"],
"openssl_include_dir": ["./openssl/x86_64/include"],
"openssl_library_dir": ["./openssl/x86_64/lib/VC/static"]
"openssl_include_dir": ["./openssl/win/x86_64/include"],
"openssl_library_dir": ["./openssl/win/x86_64/lib"]
}
},
"linux": {
"i686": {
"openssl_include_dir": ["./openssl/x86/include"],
"openssl_library_dir": ["./openssl/x86/lib"],
"openssl_include_dir": ["./openssl/linux/x86/include"],
"openssl_library_dir": ["./openssl/linux/x86/lib"],
"extra_link_args": ["-l:libcrypto.a"]
},
"x86_64": {
"openssl_include_dir": ["./openssl/x86_64/include"],
"openssl_library_dir": ["./openssl/x86_64/lib"],
"openssl_include_dir": ["./openssl/linux/x86_64/include"],
"openssl_library_dir": ["./openssl/linux/x86_64/lib"],
"extra_link_args": ["-l:libcrypto.a"]
}
},
"macos": {
"arm64": {
"openssl_libraries": ["crypto"],
"openssl_include_dir": ["./openssl/include"],
"openssl_library_dir": ["./openssl/lib"]
"openssl_include_dir": ["./openssl/macos-13/include"],
"openssl_library_dir": ["./openssl/macos-13/lib"]
},
"x86_64": {
"openssl_libraries": ["crypto"],
"openssl_include_dir": ["./openssl/include"],
"openssl_library_dir": ["./openssl/lib"]
"openssl_include_dir": ["./openssl/macos-14/include"],
"openssl_library_dir": ["./openssl/macos-14/lib"]
}
}
}

0 comments on commit 7aba4f7

Please sign in to comment.