Skip to content

v1.1.6

v1.1.6 #5

name: create-release-binaries
on:
release:
types:
- created
env:
BUILD_TYPE: Release
jobs:
build_and_publish:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: ubuntu-latest
executable_path: /build/TextExtractionCLI
executable_name: TextExtraction
os_name: linux
- os: macos-latest
executable_path: /build/TextExtractionCLI
executable_name: TextExtraction
os_name: mac
extra_cmake_config_flags: -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" # universal. arm and intel
- os: windows-latest
executable_path: /build/TextExtractionCLI/Release
executable_name: TextExtraction.exe
os_name: win
extra_cmake_config_flags: -DCMAKE_GENERATOR_PLATFORM=x64 # make sure it's x64
runs-on: ${{ matrix.os }}
permissions:
contents: write
env:
ARCHIVE_NAME: ${{ github.event.repository.name }}-${{ github.event.release.tag_name }}-${{ matrix.os_name }}.tar.gz
steps:
- uses: actions/checkout@v4
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ${{ matrix.extra_cmake_config_flags}}
- name: Build with CMake
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Create Archive
working-directory: ${{github.workspace}}${{ matrix.executable_path }}
run: tar -czf ${{env.ARCHIVE_NAME}} ${{ matrix.executable_name }}
- name: Upload to release
working-directory: ${{github.workspace}}${{ matrix.executable_path }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload ${{ github.event.release.tag_name }} ${{env.ARCHIVE_NAME}}