Skip to content

Commit

Permalink
ci: More cross platform build fixups
Browse files Browse the repository at this point in the history
Signed-off-by: Siddharth Chandrasekaran <[email protected]>
  • Loading branch information
sidcha committed Mar 21, 2024
1 parent d7cd1c7 commit d0da4f9
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 13 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,32 @@ on:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

jobs:
cross_platform_build:
name: Build on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
# macos-13 is an intel runner, macos-14 is apple silicon
os: [ubuntu-latest, macos-13, macos-14, windows-latest]
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Configure
run: cmake -B build -DCMAKE_BUILD_TYPE=Debug -DCONFIG_OSDP_LIB_ONLY=on .
- name: Build
run: cmake --build build --parallel 8
- name: Pack built binaries
run: cmake --build build --target package
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: LibOSDP-${{ github.ref }}-${{ matrix.os }}-binaries
path: build/artifacts/

build:
name: Create Release
needs: cross_platform_build
runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/cross-plaform-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,13 @@ jobs:
with:
submodules: recursive
- name: Configure
run: |
cmake -B build -DCMAKE_BUILD_TYPE=Debug -DCONFIG_OSDP_LIB_ONLY=on .
run: cmake -B build -DCMAKE_BUILD_TYPE=Debug -DCONFIG_OSDP_LIB_ONLY=on .
- name: Build
run: cmake --build build --parallel 8
- name: Pack built binaries
run: |
cmake --build build -t package
cmake --build build -t package_source
run: cmake --build build --target package
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: libosdp-${{ matrix.os }}-binaries.zip
name: libosdp-${{ matrix.os }}-binaries
path: build/artifacts/
8 changes: 3 additions & 5 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ name: Publish PyPI

on:
workflow_dispatch:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching Python-v*, i.e. v2.4.0
workflow_run:
workflows: ["Create Release"]
types: [completed]

jobs:
build_wheels:
Expand All @@ -21,7 +20,6 @@ jobs:
matrix:
# macos-13 is an intel runner, macos-14 is apple silicon
os: [ubuntu-22.04, macos-13, macos-14, windows-2022]

steps:
- uses: actions/checkout@v4
with:
Expand Down
8 changes: 6 additions & 2 deletions cmake/GitInfo.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,14 @@ if ("${GIT_REV}" STREQUAL "")
set(GIT_BRANCH "None")
else()
execute_process(
COMMAND bash -c "git diff --quiet --exit-code || echo +"
OUTPUT_VARIABLE GIT_DIFF
COMMAND git diff --quiet --exit-code
RESULT_VARIABLE RETURN_CODE
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET
)
if(RETURN_CODE AND NOT RETURN_CODE EQUAL 0)
set(GIT_DIFF "+")
endif()
execute_process(
COMMAND git describe --exact-match --tags
OUTPUT_VARIABLE GIT_TAG ERROR_QUIET
Expand Down

0 comments on commit d0da4f9

Please sign in to comment.