Skip to content

Commit

Permalink
Removed the different optimisations for macos
Browse files Browse the repository at this point in the history
  • Loading branch information
gsleap committed Sep 7, 2023
1 parent 606d3b2 commit 0bf233a
Showing 1 changed file with 26 additions and 24 deletions.
50 changes: 26 additions & 24 deletions .github/workflows/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,19 @@ PATH=/root/.cargo/bin:$PATH
rustup install 1.63 --no-self-update
rustup default 1.63

pip3 install --upgrade pip

# Setup maturin
pip3 install maturin==1.2.3

# Build a release for each x86_64 microarchitecture level. v4 can't be
# compiled on GitHub for some reason.
for level in "x86-64" "x86-64-v2" "x86-64-v3"; do
export RUSTFLAGS="-C target-cpu=${level}"

if [[ "$OSTYPE" == "linux-gnu"* ]]; then
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
# Build a release for each x86_64 microarchitecture level. v4 can't be
# compiled on GitHub for some reason.
for level in "x86-64" "x86-64-v2" "x86-64-v3"; do
export RUSTFLAGS="-C target-cpu=${level}"

# Build python first
maturin build --release --features=python,cfitsio-static --strip -i 3.7 3.8 3.9 3.10
maturin build --release --features python,cfitsio-static --strip -i 3.7 3.8 3.9 3.10

# Build C objects
cargo build --release --features cfitsio-static,examples
Expand All @@ -54,23 +56,23 @@ for level in "x86-64" "x86-64-v2" "x86-64-v3"; do
libmwalib.{a,so} mwalib.h
tar -acvf mwalib-$(git describe --tags)-linux-python-${level}.tar.gz \
LICENSE LICENSE-cfitsio README.md CHANGELOG.md \
./*.whl
elif [[ "$OSTYPE" == "darwin"* ]]; then
brew install automake
./*.whl
done
elif [[ "$OSTYPE" == "darwin"* ]]; then
brew install automake

# Build python first
maturin build --release --features=python,cfitsio-static --strip
# Build python first
maturin build --release --features python,cfitsio-static --strip -i 3.7 3.8 3.9 3.10

# Build C objects
cargo build --release --features cfitsio-static,examples

# Create new release asset tarballs
mv target/wheels/*.whl target/release/libmwalib.{a,dylib} include/mwalib.h .
tar -acvf mwalib-$(git describe --tags)-macosx-${level}.tar.gz \
LICENSE LICENSE-cfitsio README.md CHANGELOG.md \
libmwalib.{a,dylib} mwalib.h
tar -acvf mwalib-$(git describe --tags)-macosx-python-${level}.tar.gz \
# Build C objects
cargo build --release --features cfitsio-static,examples

# Create new release asset tarballs
mv target/wheels/*.whl target/release/libmwalib.{a,dylib} include/mwalib.h .
tar -acvf mwalib-$(git describe --tags)-macosx-x86-64.tar.gz \
LICENSE LICENSE-cfitsio README.md CHANGELOG.md \
./*.whl
fi
done
libmwalib.{a,dylib} mwalib.h
tar -acvf mwalib-$(git describe --tags)-macosx-python-x86-64.tar.gz \
LICENSE LICENSE-cfitsio README.md CHANGELOG.md \
./*.whl
fi

0 comments on commit 0bf233a

Please sign in to comment.