Skip to content

Commit

Permalink
Merge pull request #1 from MikeMoore63/feat/upgradeciaddosxarm64
Browse files Browse the repository at this point in the history
feat: upgrade cibuildwheel and build shared libs for osx on arm64 and…
  • Loading branch information
MikeMoore63 authored Jul 13, 2024
2 parents eaa6422 + a655ec8 commit fc3815d
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 4 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,23 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04, macos-11]
os: [ubuntu-22.04, macos-12, macos-14]

steps:
- uses: actions/checkout@v4

- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v3
with:
platforms: all

- name: Build wheels
uses: pypa/cibuildwheel@v2.16.2
uses: pypa/cibuildwheel@v2.19.2
env:
# configure cibuildwheel to build native archs ('auto'), and some
# emulated ones
CIBW_ARCHS_LINUX: auto64

- uses: actions/upload-artifact@v3
with:
Expand Down
27 changes: 26 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,37 @@ GOPATH="C:\\Go"

[tool.cibuildwheel.linux]
archs=["x86_64"]
before-all = "yum install -y golang"
before-all = '''
switch_eol_centos_repos()
{
if [ "${AUDITWHEEL_POLICY}" == "manylinux2014" ] && [ "${AUDITWHEEL_ARCH}" != "s390x" ]; then
# Centos 7 is EOL and is no longer available from the usual mirrors, so switch
# to https://vault.centos.org
sed -i 's/enabled=1/enabled=0/g' /etc/yum/pluginconf.d/fastestmirror.conf
sed -i 's/^mirrorlist/#mirrorlist/g' /etc/yum.repos.d/*.repo
sed -i 's;^.*baseurl=http://mirror;baseurl=https://vault;g' /etc/yum.repos.d/*.repo
if [ "${AUDITWHEEL_ARCH}" == "aarch64" ] || [ "${AUDITWHEEL_ARCH}" == "ppc64le" ]; then
sed -i 's;/centos/7/;/altarch/7/;g' /etc/yum.repos.d/*.repo
fi
fi
}
switch_eol_centos_repos
if [ "${AUDITWHEEL_POLICY}" == "manylinux2014" ]
then
yum install -y golang
fi
'''
environment = """
CC=gcc
CGO_ENABLED=1
"""

[tool.cibuildwheel.macos]
before-all = '''
brew install go@1.21
'''
environment = "PATH=/opt/homebrew/opt/go@1.21/bin:$PATH"

[[tool.cibuildwheel.overrides]]
select = "*-musllinux*"
before-all = "wget https://golang.org/dl/go1.21.1.linux-amd64.tar.gz;tar -C /usr/local -xzf go1.21.1.linux-amd64.tar.gz"
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = pyrustaudit
version = 0.0.2
version = 0.0.3
author = Mike Moore
author_email = z_z_zebra@yahoo.com
license = MIT
Expand Down

0 comments on commit fc3815d

Please sign in to comment.