Release #1712
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| on: | |
| push: | |
| tags: | |
| - v[0-9]+.[0-9]+.[0-9]+ | |
| schedule: | |
| - cron: '30 4 * * *' | |
| workflow_dispatch: | |
| jobs: | |
| Linux: | |
| name: 'Build Linux Release' | |
| runs-on: ${{ matrix.runner.os }} | |
| strategy: | |
| matrix: | |
| runner: | |
| - { os: ubuntu-22.04, arch: x64 } | |
| - { os: ubuntu-22.04-arm, arch: arm64 } | |
| permissions: | |
| id-token: write # For sigstore | |
| attestations: write # For artifact attestation | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| persist-credentials: false | |
| - name: Install dependencies | |
| run: | | |
| sudo apt install -y gettext doxygen graphviz ninja-build | |
| python -m pip install conan==1.* | |
| - name: Conan common config | |
| run: | | |
| conan profile new --detect default | |
| conan profile update settings.build_type=Release default | |
| conan profile update settings.compiler.libcxx=libstdc++11 default | |
| - name: Run Conan | |
| run: | | |
| mkdir build && cd build | |
| conan profile list | |
| conan profile show default | |
| conan install .. -o webready=False --build missing | |
| - name: Build packaged release | |
| run: | | |
| cmake --preset linux-all -S . -B build -DEXIV2_TEAM_PACKAGING=ON -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DEXIV2_ENABLE_WEBREADY=OFF -DEXIV2_ENABLE_CURL=OFF -DEXIV2_BUILD_SAMPLES=OFF | |
| cmake --build build -t doc | |
| cmake --build build -t package | |
| - name: Attest build provenance | |
| uses: actions/attest-build-provenance@96278af6caaf10aea03fd8d33a09a777ca52d62f # v3.2.0 | |
| with: | |
| subject-path: ./build/exiv2-*.tar.gz | |
| - uses: actions/upload-artifact@v6 | |
| with: | |
| 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: ${{ matrix.runner.os }} | |
| strategy: | |
| matrix: | |
| runner: | |
| - { os: macos-15-intel, arch: x64 } | |
| - { os: macos-14, arch: arm64 } | |
| permissions: | |
| id-token: write # For sigstore | |
| attestations: write # For artifact attestation | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| persist-credentials: false | |
| - name: Install dependencies | |
| run: | | |
| brew install inih tree doxygen graphviz | |
| - name: Build packaged release | |
| run: | | |
| cmake -GNinja -S . -B build \ | |
| -DEXIV2_TEAM_PACKAGING=ON \ | |
| -DBUILD_SHARED_LIBS=ON \ | |
| -DEXIV2_ENABLE_WEBREADY=OFF \ | |
| -DEXIV2_ENABLE_NLS=ON \ | |
| -DCMAKE_BUILD_TYPE=Release \ | |
| -DEXIV2_TEAM_WARNINGS_AS_ERRORS=ON \ | |
| -DEXIV2_BUILD_DOC=ON \ | |
| -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON | |
| cmake --build build -t doc | |
| cmake --build build -t package | |
| - name: Attest build provenance | |
| uses: actions/attest-build-provenance@96278af6caaf10aea03fd8d33a09a777ca52d62f # v3.2.0 | |
| with: | |
| subject-path: ./build/exiv2-*.tar.gz | |
| - uses: actions/upload-artifact@v6 | |
| with: | |
| 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: ${{ matrix.runner.os }} | |
| strategy: | |
| matrix: | |
| runner: | |
| - { os: windows-2022, arch: x64 } | |
| permissions: | |
| id-token: write # For sigstore | |
| attestations: write # For artifact attestation | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| persist-credentials: false | |
| - name: Set up Visual Studio shell | |
| uses: ilammy/msvc-dev-cmd@v1 | |
| - name: Install doxygen | |
| run: | | |
| choco install doxygen.install | |
| choco install graphviz | |
| - name: Restore conan cache | |
| uses: actions/cache@v5 | |
| with: | |
| path: ${{github.workspace}}/conanCache | |
| key: ${{runner.os}}-release-win-${{ hashFiles('conanfile.py') }} | |
| lookup-only: true | |
| - name: Install Conan & Common config | |
| run: | | |
| python -m pip install conan==1.* | |
| conan profile new --detect default | |
| conan profile show default | |
| conan profile update settings.build_type=Release default | |
| conan profile update settings.compiler="Visual Studio" default | |
| conan profile update settings.compiler.version=17 default | |
| conan config set storage.path=$Env:GITHUB_WORKSPACE/conanCache | |
| - name: Run Conan | |
| run: | | |
| md build | |
| cd build | |
| conan install .. --build missing | |
| - name: Build packaged release | |
| run: | | |
| cmake --preset win-release -S . -B build -DEXIV2_TEAM_PACKAGING=ON -DEXIV2_BUILD_DOC=ON -DEXIV2_ENABLE_WEBREADY=OFF -DEXIV2_ENABLE_CURL=OFF -DEXIV2_BUILD_SAMPLES=OFF | |
| cmake --build build --parallel -t doc | |
| cmake --build build --parallel -t package | |
| - name: Attest build provenance | |
| uses: actions/attest-build-provenance@96278af6caaf10aea03fd8d33a09a777ca52d62f # v3.2.0 | |
| with: | |
| subject-path: ./build/exiv2-*.zip | |
| - uses: actions/upload-artifact@v6 | |
| with: | |
| name: exiv2-${{ matrix.runner.arch }}-${{ matrix.runner.os }} | |
| path: ./build/exiv2-*.zip | |
| if-no-files-found: error | |
| retention-days: 1 | |
| publish: | |
| needs: [Linux, macOS, Windows] | |
| runs-on: ubuntu-22.04 | |
| permissions: | |
| contents: write | |
| if: github.event_name == 'push' # only publish when a new version tag is pushed | |
| steps: | |
| - uses: actions/download-artifact@v7 | |
| - name: List downloaded files | |
| run: tree -L 3 | |
| - name: Create GitHub Release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| GITHUB_REPO: ${{ github.repository }} | |
| RELEASE_NAME: ${{ github.ref_name }} | |
| run: gh release create "$RELEASE_NAME" ./exiv2-*/exiv2-* --repo "$GITHUB_REPO" --generate-notes |