Skip to content

Commit

Permalink
Add build and release steps for macOS and linux
Browse files Browse the repository at this point in the history
  • Loading branch information
andy-sweet committed Oct 2, 2023
1 parent dab7964 commit b35cba6
Show file tree
Hide file tree
Showing 2 changed files with 141 additions and 3 deletions.
68 changes: 66 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,77 @@ jobs:
with:
arch: amd64_x86

- name: Package
- name: CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release -DNOTEST=1

- name: Build
run: |
cmake -B ${{github.workspace}}/pack -DCMAKE_BUILD_TYPE=Release -DNOTEST=1
cmake --build ${{github.workspace}}/pack --config Release
cpack --config ${{github.workspace}}/pack/CPackConfig.cmake -C Release -G ZIP
- uses: actions/upload-artifact@v3
with:
name: windows-latest Release binaries
path: ${{github.workspace}}/*.zip

linux-build:
name: "Build on Ubuntu"
runs-on:
- ubuntu-latest

permissions:
actions: write

steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- name: Checkout
uses: actions/checkout@v3
with:
submodules: true

- name: CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release -DNOTEST=1

- name: Build
run: |
cmake --build ${{github.workspace}}/pack --config Release
cpack --config ${{github.workspace}}/pack/CPackConfig.cmake -C Release -G ZIP
- uses: actions/upload-artifact@v3
with:
name: ubuntu-latest Release binaries
path: ${{github.workspace}}/*.zip

mac-build:
name: "Build on Mac"
runs-on: macos-latest

permissions:
actions: write

steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- uses: actions/checkout@v3
with:
submodules: true

- name: CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release -DNOTEST=1 -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64"

- name: Build
run: |
cmake --build ${{github.workspace}}/build --config Release
cpack --config ${{github.workspace}}/build/CPackConfig.cmake -C Release -G ZIP
- uses: actions/upload-artifact@v3
with:
name: macos-latest Release binaries
path: ${{github.workspace}}/*.zip
76 changes: 75 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ jobs:
ctest -C Release -L anyplatform --output-on-failure
ctest -C Release -L acquire-driver-spinnaker --output-on-failure
- name: Package
- name: CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release -DNOTEST=1

- name: Build
run: |
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release -DNOTEST=1
cmake --build ${{github.workspace}}/build --config Release
Expand All @@ -72,9 +75,80 @@ jobs:
name: Windows Release binaries
path: ${{github.workspace}}/*.zip

linux-build:
name: "Build on Ubuntu"
runs-on:
- ubuntu-latest

permissions:
actions: write

steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- uses: actions/checkout@v3
with:
submodules: true

- name: CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release -DNOTEST=1

- name: Build
run: |
cmake --build ${{github.workspace}}/build --config Release
cpack --config ${{github.workspace}}/build/CPackConfig.cmake -C Release -G ZIP
- name: Test # don't release unless tests pass
working-directory: ${{github.workspace}}/build
run: ctest -C Release -L anyplatform --output-on-failure

- uses: actions/upload-artifact@v3
with:
name: ubuntu-latest Release binaries
path: ${{github.workspace}}/*.zip

mac-build:
name: "Build on Mac"
runs-on: macos-latest

permissions:
actions: write

steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- uses: actions/checkout@v3
with:
submodules: true

- name: CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release -DNOTEST=1 -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64"

- name: Build
run: |
cmake --build ${{github.workspace}}/build --config Release
cpack --config ${{github.workspace}}/build/CPackConfig.cmake -C Release -G ZIP
- name: Test # don't release unless tests pass
working-directory: ${{github.workspace}}/build
run: ctest -C Release -L anyplatform --output-on-failure

- uses: actions/upload-artifact@v3
with:
name: macos-latest Release binaries
path: ${{github.workspace}}/*.zip

release:
needs:
- windows-build
- linux-build
- mac-build
name: "Release"
runs-on: "ubuntu-latest"

Expand Down

0 comments on commit b35cba6

Please sign in to comment.