Skip to content

feat: Build and Publish refactor #33

feat: Build and Publish refactor

feat: Build and Publish refactor #33

Workflow file for this run

name: 'Build Binary'
description: |
This workflow builds the binary files for Linux. The build binaries are stored as artifact
and may be reused by other workflows.
on:
push:
branches: [ main ]
pull_request: {}
jobs:
build-binary:
name: 'Build Binary'
runs-on: ubuntu-latest
steps:
- name: 'Checkout repository'
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up GCC
uses: egor-tensin/setup-gcc@v2
with:
version: '14'
platform: 'x64'
- name: 'Setup CMake'
uses: jwlawson/actions-setup-cmake@v2
with:
cmake-version: '3.31.x'
- name: 'Configure CMake'
env:
CXX: g++
run: |
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release
- name: 'Build'
id: 'build'
run: |
cmake --build build --config Release
. build/env.sh
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
- name: 'Upload artifacts'
uses: actions/upload-artifact@v4
with:
name: libcpp_bindings_linux_x86_64
path: build/libcpp_bindings_linux.so*
outputs:
version: ${{ steps.build.outputs.VERSION }}
trigger-publish:
name: 'Trigger Publish'
needs: ['build-binary']
uses: ./.github/workflows/publish_jsr.yml
with:
publish: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
version: ${{ needs.build-binary.outputs.version }}
artifact-name: libcpp_bindings_linux_x86_64
permissions:
contents: read
id-token: write