Skip to content

MAINT: Update

MAINT: Update #323

# This CI run builds wheels using the cibuildwheel infrastructure
# to build the C++ binaries (with no Python wrappers).
name: installers
concurrency:
group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.ref }}
cancel-in-progress: true
permissions:
contents: write
on:
push:
branches: [ main ]
tags:
- '*'
pull_request:
branches: [ main ]
env:
BUILD_TYPE: Release
# https://cibuildwheel.readthedocs.io/en/stable/setup/#github-actions
jobs:
apps:
continue-on-error: false
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-20.04
- os: macos-11
archs_macos: "x86_64"
- os: macos-11
archs_macos: "arm64"
- os: windows-2019
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- uses: hendrikmuhs/ccache-action@v1.2
if: matrix.os != 'ubuntu-20.04'
with:
key: ${{ github.job }}-${{ matrix.os }}-${{ matrix.archs_macos }}
- name: Cache vcpkg
if: matrix.os != 'ubuntu-20.04'
uses: actions/cache@v3
with:
path: |
vcpkg
build/vcpkg_installed
key: ${{ github.job }}-vcpkg-${{ hashFiles('**/vcpkg.json') }}-${{ matrix.os }}-${{ matrix.archs_macos }}-0
- uses: pypa/cibuildwheel@v2.16.2
with:
package-dir: ./wrapping/python
output-dir: installers
env:
CIBW_ARCHS_MACOS: "${{matrix.archs_macos}}"
CIBW_ENVIRONMENT_LINUX: "RUNNER_OS=Linux"
CIBW_ENVIRONMENT_MACOS: "OPENMEEG_MACOS_WHEEL_PURE=false"
CIBW_ENVIRONMENT_WINDOWS: ""
CIBW_BUILD: "cp310-*"
CIBW_BEFORE_ALL: "bash {project}/build_tools/cibw_before_all_apps.sh {project}"
CIBW_BEFORE_BUILD_WINDOWS: ""
CIBW_REPAIR_WHEEL_COMMAND_LINUX: ""
CIBW_REPAIR_WHEEL_COMMAND_MACOS: ""
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: ""
CIBW_TEST_COMMAND: "bash {project}/build_tools/cibw_test_command_apps.sh {project}"
- uses: actions/upload-artifact@v3
with:
path: |
./installers/OpenMEEG-*.tar.gz
name: OpenMEEG-installers
release:
needs: [apps]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
name: OpenMEEG-installers
- name: Set vars
id: vars
run: |
set -e
echo "Using ref_type=${{ github.ref_type }}"
if [[ "${{ github.ref_type }}" != "tag" ]]; then
echo '::set-output name=name::dev' # default empty uses tag
echo '::set-output name=body::body.md' # default empty
else
echo '::set-output name=generate::true' # default false
fi
echo "# Development release" >> body.md
echo "" >> body.md
echo "This is an unreleased draft version (only visible to maintainers)." >> body.md
echo "" >> body.md
echo "- Created: $(date +'%Y-%m-%dT%H:%M:%S%z')" >> body.md
echo "- Commit: `${{ github.sha }}`" >> body.md
cat body.md
- name: Check files
run: |
set -e
ls -alR .
for key in body name generate; do
echo "Using vars.outputs.${key}=${{ steps.vars.outputs.body }}"
done
# https://github.com/ncipollo/release-action
# https://github.com/softprops/action-gh-release
- uses: softprops/action-gh-release@v1
if: github.ref_type == 'tag' || github.event_name != 'pull_request'
with:
draft: true
prerelease: true
body_path: ${{ steps.vars.outputs.body }}
generate_release_notes: ${{ steps.vars.outputs.generate }}
tag_name: ${{ steps.vars.outputs.name }}
files: OpenMEEG-*