- Nope, because then artifacts are a pain. So, a job for each arch and os.

This commit is contained in:
Jason von Nieda 2023-02-15 22:34:03 -06:00
parent ca6a5b39a1
commit 9d083f6ac4
2 changed files with 121 additions and 0 deletions

120
.github/workflows/build.yml vendored Normal file
View File

@ -0,0 +1,120 @@
on:
push:
pull_request:
jobs:
macos_x86_64:
strategy:
matrix:
os: [macos-latest]
arch: [x86_64]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Build
run: |
mkdir build
mkdir deploy
cd build
cmake ..
make
cd ..
cp build/mac/tests/openpnp-capture-test deploy/openpnp-capture-test-${{ matrix.os }}-${{ matrix.arch }}
cp build/libopenpnp-capture.dylib deploy/libopenpnp-capture-${{ matrix.os }}-${{ matrix.arch }}.dylib
- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
path: |
deploy/*
- name: Create Release
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
uses: ncipollo/release-action@v1
with:
artifacts: "deploy/*"
token: ${{ secrets.GITHUB_TOKEN }}
allowUpdates: true
macos_aarch64:
strategy:
matrix:
os: [macos-latest]
arch: [aarch64]
# Currently runs on Jason's Mac using a Github self hosted runner because Github doesn't
# yet support runners for Apple Silicon on macOS.
runs-on: [self-hosted, macOS, ARM64]
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Build
run: |
mkdir build
mkdir deploy
cd build
cmake ..
make
cd ..
cp build/mac/tests/openpnp-capture-test deploy/openpnp-capture-test-${{ matrix.os }}-${{ matrix.arch }}
cp build/libopenpnp-capture.dylib deploy/libopenpnp-capture-${{ matrix.os }}-${{ matrix.arch }}.dylib
- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
path: |
deploy/*
- name: Create Release
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
uses: ncipollo/release-action@v1
with:
artifacts: "deploy/*"
token: ${{ secrets.GITHUB_TOKEN }}
allowUpdates: true
windows_x86_64:
strategy:
matrix:
os: [windows-latest]
arch: [x86_64]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Build
run: |
mkdir build
mkdir deploy
cd build
cmake -DCMAKE_BUILD_TYPE=Release cmake -G "Unix Makefiles" ..
make
cd ..
cp build/win/tests/openpnp-capture-test.exe deploy/openpnp-capture-test-${{ matrix.os }}-${{ matrix.arch }}.exe
cp build/libopenpnp-capture.dll deploy/libopenpnp-capture-${{ matrix.os }}-${{ matrix.arch }}.dll
- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
path: |
deploy/*
- name: Create Release
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
uses: ncipollo/release-action@v1
with:
artifacts: "deploy/*"
token: ${{ secrets.GITHUB_TOKEN }}
allowUpdates: true

1
.gitignore vendored
View File

@ -14,3 +14,4 @@ QtCaptureTest/build
openpnp-capture.iml
out
cmake-build-*/
actions-runner