Skip to content

Commit 8ca7e8b

Browse files
authored
add conan mac packaging (#73)
1 parent b46610f commit 8ca7e8b

2 files changed

Lines changed: 17 additions & 14 deletions

File tree

.github/workflows/build.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,20 @@ jobs:
4444
ctest --test-dir build --output-on-failure
4545
4646
- name: Upload Build Artifact
47-
if: matrix.os == 'ubuntu-latest' && matrix.build_type == 'Release'
47+
if: matrix.build_type == 'Release'
4848
uses: actions/upload-artifact@v4
4949
with:
50-
name: build-linux
50+
name: build-${{ matrix.os }}
5151
path: build/
5252
retention-days: 1
5353

5454
build-conan-package:
5555
needs: build
5656
name: Build Conan Package
57-
runs-on: ubuntu-latest
57+
runs-on: ${{ matrix.os }}
58+
strategy:
59+
matrix:
60+
os: [ubuntu-latest, macos-latest]
5861

5962
steps:
6063
- uses: actions/checkout@v4
@@ -66,7 +69,7 @@ jobs:
6669
- name: Download Build Artifacts
6770
uses: actions/download-artifact@v4
6871
with:
69-
name: build-linux
72+
name: build-${{ matrix.os }}
7073
path: build/
7174

7275
- name: Determine version
@@ -83,11 +86,11 @@ jobs:
8386
8487
- name: Export Conan package
8588
run: |
86-
conan cache save "real-time-monitor/${{ env.PKG_VERSION }}:*" --file real-time-monitor-${{ env.PKG_VERSION }}-linux-x86_64.tgz
89+
conan cache save "real-time-monitor/${{ env.PKG_VERSION }}:*" --file real-time-monitor-${{ env.PKG_VERSION }}-${{ matrix.os }}.tgz
8790
8891
- name: Upload Conan package artifact
8992
uses: actions/upload-artifact@v4
9093
with:
91-
name: conan-package
92-
path: real-time-monitor-${{ env.PKG_VERSION }}-linux-x86_64.tgz
94+
name: conan-package-${{ matrix.os }}
95+
path: real-time-monitor-${{ env.PKG_VERSION }}-${{ matrix.os }}.tgz
9396
if-no-files-found: error

conan/all/conanfile.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,16 @@ def validate(self):
5050
if self.settings.compiler.get_safe("cppstd"):
5151
check_min_cppstd(self, 17)
5252

53-
if self.settings.os not in ["Linux"]:
53+
if self.settings.os not in ["Linux", "Macos"]:
5454
raise ConanInvalidConfiguration(
5555
f"{self.ref} is not supported on {self.settings.os}.")
5656

57-
if self.settings.compiler != "gcc":
58-
raise ConanInvalidConfiguration(
59-
f"{self.ref} is not supported on {self.settings.compiler}.")
60-
61-
if self.settings.compiler == 'gcc' and Version(self.settings.compiler.version) < "11":
62-
raise ConanInvalidConfiguration("Building requires GCC >= 11")
57+
if self.settings.os == "Linux":
58+
if self.settings.compiler != "gcc":
59+
raise ConanInvalidConfiguration(
60+
f"{self.ref} on Linux requires GCC.")
61+
if Version(self.settings.compiler.version) < "11":
62+
raise ConanInvalidConfiguration("Building requires GCC >= 11")
6363

6464
def requirements(self):
6565
pass

0 commit comments

Comments
 (0)