testing macos-14 release #61
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
# Do this on every push with a version tag | |
on: | |
push: | |
tags: | |
- "v*" | |
env: | |
CARGO_TERM_COLOR: always | |
CARGO_INCREMENTAL: 0 | |
jobs: | |
build-release: | |
name: Build release for ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macOS-latest, macOS-14] | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Install stable toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
- name: Add Python versions | |
uses: actions/setup-python@v5 | |
if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'macOS-latest' }} | |
with: | |
python-version: | | |
- "3.8" | |
- "3.9" | |
- "3.10" | |
- "3.11" | |
- "3.12" | |
architecture: "x64" | |
# - name: Add Python versions | |
# uses: actions/setup-python@v2 | |
# if: matrix.os == "macOS-14" | |
# with: | |
# python-version: "3.12" | |
# architecture: "arm64" | |
- name: install cfitsio | |
run: | | |
cd /tmp | |
curl "https://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/cfitsio-3.49.tar.gz" -o cfitsio.tar.gz | |
tar -xf cfitsio.tar.gz | |
rm cfitsio.tar.gz | |
cd cfitsio-3.49 | |
./configure --prefix=/usr/local --enable-reentrant --disable-curl | |
sudo make shared | |
sudo make install | |
cd .. | |
if [[ "$OSTYPE" == "linux-gnu"* ]]; then | |
sudo ldconfig | |
fi | |
- name: install maturin | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install maturin[patchelf] | |
- name: build mwalib | |
env: | |
MWALIB_LINK_STATIC_CFITSIO: 1 | |
run: | | |
export RUSTFLAGS="-C target-cpu=$(uname -m)" | |
# Build python first | |
maturin build --release --features python --strip | |
# Build C objects | |
cargo build --release --features examples | |
# Create new release asset tarballs | |
mv target/wheels/*.whl target/release/libmwalib.{a,so,dylib} include/mwalib.h . | |
tar -acvf mwalib-$(git describe --tags)-linux-$(uname -m).tar.gz \ | |
LICENSE LICENSE-cfitsio README.md CHANGELOG.md \ | |
libmwalib.{a,so,dylib} mwalib.h | |
tar -acvf mwalib-$(git describe --tags)-linux-python-$(uname -m).tar.gz \ | |
LICENSE LICENSE-cfitsio README.md CHANGELOG.md \ | |
./*.whl | |
- name: Upload tarball | |
uses: actions/upload-artifact@v2 | |
with: | |
name: ${{ matrix.os }}.tar.gz | |
path: "*.tar.gz" | |
if-no-files-found: error | |
create-release: | |
name: Create a new release | |
runs-on: ubuntu-latest | |
needs: [build-release] | |
steps: | |
- name: Download Linux artifact | |
uses: actions/download-artifact@v2 | |
with: | |
name: ubuntu-latest.tar.gz | |
- name: Download MacOS x86_64 artifact | |
uses: actions/download-artifact@v2 | |
with: | |
name: macOS-latest.tar.gz | |
- name: Download MacOS arm64 artifact | |
uses: actions/download-artifact@v2 | |
with: | |
name: macOS-14.tar.gz | |
- name: Provide new release asset | |
uses: "marvinpinto/action-automatic-releases@latest" | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
prerelease: false | |
files: | | |
*.tar.gz | |
# build-macos-release: | |
# name: Build release for MacOS | |
# runs-on: macos-latest | |
# steps: | |
# - name: Checkout sources | |
# uses: actions/checkout@v3 | |
# with: | |
# fetch-depth: 0 | |
# - name: Install stable toolchain | |
# uses: actions-rs/toolchain@v1 | |
# with: | |
# profile: minimal | |
# toolchain: stable | |
# override: true | |
# - name: Add Python versions | |
# uses: actions/setup-python@v2 | |
# with: | |
# python-version: | | |
# "3.8" | |
# "3.9" | |
# "3.10" | |
# "3.11" | |
# "3.12" | |
# architecture: "x64" | |
# - name: Build mwalib | |
# run: ./.github/workflows/build.sh | |
# shell: bash | |
# - name: Upload tarball | |
# uses: actions/upload-artifact@v2 | |
# with: | |
# name: macos-x86_64.tar.gz | |
# path: "*.tar.gz" | |
# if-no-files-found: error | |
# build-apple-silicon-release: | |
# name: Build release for Apple Sillycon | |
# runs-on: macos-14 | |
# steps: | |
# - name: Show env | |
# run: set -x; env; uname -m; uname -s | |
# - name: Checkout sources | |
# uses: actions/checkout@v3 | |
# with: | |
# fetch-depth: 0 | |
# - name: Install stable toolchain | |
# uses: actions-rs/toolchain@v1 | |
# with: | |
# profile: minimal | |
# toolchain: stable | |
# override: true | |
# - name: Add Python versions | |
# uses: actions/setup-python@v2 | |
# with: | |
# python-version: | | |
# "3.10" | |
# "3.11" | |
# "3.12" | |
# architecture: "x64" | |
# - name: show env | |
# run: whereis python | |
# - name: Build mwalib | |
# run: ./.github/workflows/build.sh | |
# shell: bash | |
# - name: Upload tarball | |
# uses: actions/upload-artifact@v2 | |
# with: | |
# name: macos-arm64.tar.gz | |
# path: "*.tar.gz" | |
# if-no-files-found: error | |
# create-release: | |
# name: Create a new release | |
# runs-on: ubuntu-latest | |
# needs: [build-linux-release, build-macos-release, build-apple-silicon-release] | |
# steps: | |
# - name: Download Linux artifact | |
# uses: actions/download-artifact@v2 | |
# with: | |
# name: linux.tar.gz | |
# - name: Download MacOS x86_64 artifact | |
# uses: actions/download-artifact@v2 | |
# with: | |
# name: macos-x86_64.tar.gz | |
# - name: Download MacOS arm64 artifact | |
# uses: actions/download-artifact@v2 | |
# with: | |
# name: macos-arm64.tar.gz | |
# - name: Provide new release asset | |
# uses: "marvinpinto/action-automatic-releases@latest" | |
# with: | |
# repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
# prerelease: false | |
# files: | | |
# *.tar.gz |