v0.2.1 Update GH actions to support macos arm64 and x86_x64 architect… #218
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: MacOS | |
on: | |
push: | |
branches: [ "master", "dev_actions" ] | |
tags: [ '**' ] | |
jobs: | |
build-macos: | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 30 | |
strategy: | |
fail-fast: true | |
matrix: | |
os: [macos-13, macos-12] | |
platform: [arm64, x86_x64] | |
python-version: ["3.12", "3.11", "3.10", "3.9"] | |
include: | |
- os: macos-14 | |
platform: arm64 | |
python-version: "3.12" | |
force: true | |
- os: macos-14 | |
platform: arm64 | |
python-version: "3.11" | |
force: true | |
- os: macos-14 | |
platform: x86_x64 | |
python-version: "3.12" | |
force: true | |
- os: macos-14 | |
platform: x86_x64 | |
python-version: "3.11" | |
force: true | |
steps: | |
# if matrix.force is not true or event is not tag, skip | |
- if: ${{ matrix.force }} != true || (github.event_name == 'push' && !startsWith(github.ref, 'refs/tags')) | |
run: | |
echo "Skipping job for ${{ matrix.os }} ${{ matrix.python-version }}" | |
exit 0 | |
- name: Check out repository | |
uses: actions/checkout@v3 | |
- name: Setup python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
architecture: x64 | |
- name: Install setuptools (needed from Python 3.12) | |
run: pip install setuptools | |
- name: Set up GraalVM Native Image toolchain | |
uses: graalvm/setup-graalvm@v1 | |
with: | |
java-version: '22' | |
distribution: 'graalvm' | |
- name: Install Swig | |
run: brew install swig | |
- name: Update repository | |
run: | | |
git submodule update --init --recursive | |
- name: Build | |
run: | | |
sh build.sh | |
pip install pychoco -f dist/ | |
- name: Test | |
run: | | |
pip install pytest | |
pip install -r requirements_tests.txt | |
pytest | |
- name: Upload wheel artifacts | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
uses: actions/upload-artifact@v4 | |
with: | |
name: wheel-${{matrix.os}}-${{matrix.python-version}}-${{matrix.platform}}-artifact | |
path: dist/ | |
if-no-files-found: error | |
upload-pypi-macos: | |
needs: build-macos | |
runs-on: ubuntu-20.04 | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
strategy: | |
matrix: | |
os: [macos-13, macos-12] | |
platform: [arm64, x86_x64] | |
python-version: ["3.12", "3.11", "3.10", "3.9"] | |
include: | |
- os: macos-14 | |
platform: arm64 | |
python-version: "3.12" | |
force: true | |
- os: macos-14 | |
platform: arm64 | |
python-version: "3.11" | |
force: true | |
- os: macos-14 | |
platform: x86_x64 | |
python-version: "3.12" | |
force: true | |
- os: macos-14 | |
platform: x86_x64 | |
python-version: "3.11" | |
force: true | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: wheel-${{matrix.os}}-${{matrix.python-version}}-artifact | |
path: dist | |
- name: List files | |
run: ls -R | |
- name: Upload to PyPi | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_API_TOKEN }} | |
verbose: true |