Skip to content
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 33 additions & 19 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches: ["main"]
pull_request:
branches: ["main"]
workflow_dispatch:

permissions:
contents: read
Expand All @@ -16,6 +17,7 @@ jobs:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
build: [Release]
os: [ubuntu-latest, windows-latest]

# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
# You can convert this to a matrix build if you need cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
Expand All @@ -26,21 +28,21 @@ jobs:
uses: actions/checkout@v3

- name: Install dependencies (Windows)
if: ${{ (matrix.OS == 'windows-latest') }}
if: ${{ (matrix.os == 'windows-latest') }}
# on Windows, we rely on vcpkg to pull in dependencies
shell: bash
run: |
vcpkg install xerces-c --triplet x64-windows-static

- name: Install dependencies (Linux)
if: ${{ (matrix.OS == 'ubuntu-latest') }}
if: ${{ (matrix.os == 'ubuntu-latest') }}
# on Linux, we use apt to get our dependencies
shell: bash
run: |
sudo apt-get install libxerces-c-dev -y

- name: Configure CMake (Windows)
if: ${{ (matrix.OS == 'windows-latest') }}
if: ${{ (matrix.os == 'windows-latest') }}
shell: bash
run: |
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
Expand All @@ -52,7 +54,7 @@ jobs:
-DCZICHECK_BUILD_TESTS=ON

- name: Configure CMake (Linux)
if: ${{ (matrix.OS == 'ubuntu-latest') }}
if: ${{ (matrix.os == 'ubuntu-latest') }}
shell: bash
run: |
cmake -B "${{github.workspace}}/build" -DCMAKE_BUILD_TYPE=${{matrix.build}} \
Expand All @@ -68,29 +70,41 @@ jobs:
cd "${{github.workspace}}/build"
ctest -C ${{matrix.build}} --verbose

# gather the binaries and put them into a zip-file
- name: Prepare licenses
if: matrix.build == 'Release'
shell: bash
run: |
cp -R ./THIRD_PARTY_LICENSES.txt ./build/CZICheck/

- name: Package
if: ${{ (matrix.OS == 'ubuntu-latest') }}
if: ${{ (matrix.os == 'ubuntu-latest') }}
shell: bash
run: |
mkdir release
name="CZICheck-linux-x64-$(git describe --always)"
mkdir "release/${name}"
cd ./build/CZICheck
zip -r ./../../CZICheck.zip CZICheck
cp "CZICheck" "./../../release/${name}/"
cp "THIRD_PARTY_LICENSES.txt" "./../../release/${name}/"
cd ../..
name="CZICheck-linux-x64-$(git describe --always).zip"
mv -v ./CZICheck.zip "release/${name}"
echo "name=${name}" >> "$GITHUB_OUTPUT"
echo "path=release/${name}" >> "$GITHUB_OUTPUT"
echo "artifactName=Linux-x64" >> "$GITHUB_ENV" # set the artifactName for the upload step
echo "artifactName=${name}" >> "$GITHUB_ENV"
echo "artifactPath=release/${name}" >> "$GITHUB_ENV"

- name: Package
if: ${{ (matrix.OS == 'windows-latest') }}
if: ${{ (matrix.os == 'windows-latest') }}
shell: bash
run: |
mkdir release
7z a -r CZICheck.zip "./build/CZICheck/${{env.BUILD_TYPE}}/*.exe"
name="CZICheck-windows-win64-$(git describe --always).zip"
mv -v ./CZICheck.zip "release/${name}"
echo "name=${name}" >> "$GITHUB_OUTPUT"
echo "path=release/${name}" >> "$GITHUB_OUTPUT"
echo "artifactName=Windows-x64" >> "$GITHUB_ENV" # set the artifactName for the upload step
name="CZICheck-windows-x64-$(git describe --always)"
mkdir "release/${name}"
cp ./build/CZICheck/${{ matrix.build }}/*.exe "release/${name}/"
cp ./build/CZICheck/THIRD_PARTY_LICENSES.txt "release/${name}/"
echo "artifactName=${name}" >> "$GITHUB_ENV"
echo "artifactPath=release/${name}" >> "$GITHUB_ENV"

- name: Upload artifacts
if: matrix.build == 'Release'
uses: actions/upload-artifact@v4
with:
path: ${{ env.artifactPath }}/
name: ${{ env.artifactName }}
2 changes: 1 addition & 1 deletion .reuse/dep5
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Upstream-Name: CZICheck
Upstream-Contact: Carl Zeiss Microscopy GmbH <github.microscopy@zeiss.com>
Source: https://github.com/ZEISS/czicheck

Files: .github/* .gitignore README.md LICENSE CODE_OF_CONDUCT.md CONTRIBUTING.md README.md SECURITY.md cla_corporate.txt cla_individual.txt
Files: .github/* .gitignore README.md LICENSE CODE_OF_CONDUCT.md CONTRIBUTING.md README.md SECURITY.md cla_corporate.txt cla_individual.txt THIRD_PARTY_LICENSES.txt
Copyright: 2023 Carl Zeiss Microscopy GmbH
License: MIT

Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
cmake_minimum_required(VERSION 3.15)

project(CZICheck
VERSION 0.5.0
VERSION 0.5.1
HOMEPAGE_URL "https://github.com/ZEISS/czicheck"
DESCRIPTION "CZICheck is a validator for CZI-documents")

Expand Down
Loading
Loading