Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: add release on macos-14 #2950

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
30 changes: 21 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ on:
jobs:
Linux:
name: 'Build Linux Release'
runs-on: ubuntu-22.04
runs-on: ${{ matrix.runner.os }}
strategy:
matrix:
runner:
- { os: ubuntu-22.04, arch: x64 }
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -48,14 +52,19 @@ jobs:

- uses: actions/upload-artifact@v4
with:
name: exiv2-linux64
name: exiv2-${{ matrix.runner.arch }}-${{ matrix.runner.os }}
path: ./build/exiv2-*.tar.gz
if-no-files-found: error
retention-days: 1

macOS:
name: 'Build macOS Release'
runs-on: macos-latest
runs-on: ${{ matrix.runner.os }}
strategy:
matrix:
runner:
- { os: macos-12, arch: x64 }
- { os: macos-14, arch: arm64 }
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -86,14 +95,18 @@ jobs:

- uses: actions/upload-artifact@v4
with:
name: exiv2-macos
name: exiv2-${{ matrix.runner.arch }}-${{ matrix.runner.os }}
path: ./build/exiv2-*.tar.gz
if-no-files-found: error
retention-days: 1

Windows:
name: 'Build Windows Release'
runs-on: windows-2022
runs-on: ${{ matrix.runner.os }}
strategy:
matrix:
runner:
- { os: windows-2022, arch: x64 }
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -135,7 +148,7 @@ jobs:

- uses: actions/upload-artifact@v4
with:
name: exiv2-win
name: exiv2-${{ matrix.runner.arch }}-${{ matrix.runner.os }}
path: ./build/exiv2-*.zip
if-no-files-found: error
retention-days: 1
Expand Down Expand Up @@ -222,6 +235,5 @@ jobs:
prerelease: ${{ env.TAG_NAME == 'nightly' }}
tag_name: ${{ env.TAG_NAME }}
files: |
./exiv2-linux64/exiv2-*
./exiv2-macos/exiv2-*
./exiv2-win/exiv2-*
./exiv2-*/exiv2-*

13 changes: 5 additions & 8 deletions cmake/packaging.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,10 @@ else()
set(CPACK_GENERATOR TGZ) # MinGW/Cygwin/Linux/macOS etc use .tar.gz
endif()

set (BS "") # Bit Size
if ( NOT APPLE )
if ( CMAKE_SIZEOF_VOID_P EQUAL 8 )
set (BS 64)
else()
set (BS 32)
endif()
set (BARCH ${CMAKE_HOST_SYSTEM_PROCESSOR}) # Target architecture
if ( CMAKE_SIZEOF_VOID_P EQUAL 4 )
# 32-bit build, force architecture
set (BARCH "i686")
endif()

set (LT "") # Library Type
Expand Down Expand Up @@ -113,7 +110,7 @@ endif()
# Set RV = Release Version
set(RV "Exiv2 v${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")

set(CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${VS}${BUNDLE_NAME}${BS}${CC}${LT}${BT}${WR})
set(CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${BARCH}-${VS}${BUNDLE_NAME}${CC}${LT}${BT}${WR})

# https://stackoverflow.com/questions/17495906/copying-files-and-including-them-in-a-cpack-archive
install(FILES "${PROJECT_SOURCE_DIR}/samples/exifprint.cpp" DESTINATION "samples")
Expand Down
Loading