Skip to content

Commit

Permalink
feat: adding release binaries (default compilation)
Browse files Browse the repository at this point in the history
  • Loading branch information
galkahana committed Jun 11, 2024
1 parent 78ad2a2 commit 987af90
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
Expand Down
50 changes: 50 additions & 0 deletions .github/workflows/create-release-binaries.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
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}}

0 comments on commit 987af90

Please sign in to comment.