-
Notifications
You must be signed in to change notification settings - Fork 20
50 lines (48 loc) · 1.87 KB
/
create-release-binaries.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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="arm64;x86_64" # 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}} -DUSE_BIDI=1 ${{ 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}}