diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 375bae91d7..a1ecbc2be5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 @@ -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 @@ -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 @@ -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 @@ -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-* + diff --git a/cmake/packaging.cmake b/cmake/packaging.cmake index 9204c9824f..6d2edac7e6 100644 --- a/cmake/packaging.cmake +++ b/cmake/packaging.cmake @@ -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 @@ -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")