Skip to content

Commit

Permalink
feat(ci) Adds manual workflow for publishing releases
Browse files Browse the repository at this point in the history
  • Loading branch information
gmbeard committed Mar 10, 2024
1 parent 2907cf6 commit ec12fcf
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
39 changes: 39 additions & 0 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: CMake

on:
workflow_dispatch: {}
push:
branches:
- feature/publish-release-from-ci

env:
BUILD_TYPE: Release

jobs:
build-and-test:
strategy:
matrix:
os:
- ubuntu-latest
- macos-13
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Configure CMake
env:
BUILD_DIR: build-${{ matrix.os }}
run: cmake -B ${{github.workspace}}/${BUILD_DIR} -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DSEMVERUTIL_ENABLE_TESTS=ON -DSEMVERUTIL_STATIC_BINARY=ON
- name: Build
env:
BUILD_DIR: build-${{ matrix.os }}
run: cmake --build ${{github.workspace}}/${BUILD_DIR} --config ${{env.BUILD_TYPE}}
- name: Test
working-directory: ${{github.workspace}}/${{ matrix.os }}
run: ctest -C ${{ env.BUILD_TYPE }} --output-on-failure
- name: Upload
uses: actions/upload-artifact@v4
with:
name: dist=${{ matrix.os }}
path: |
${{ matrix.os }}/src/semverutil
3 changes: 2 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@ add_executable(
main.cpp
)

if (NOT DARWIN)
target_link_options(
semverutilbin
PRIVATE
$<$<BOOL:${SEMVERUTIL_STATIC_BINARY}>:-static -static-libgcc -static-libstdc++>
)
endif ()

target_link_libraries(
semverutilbin
Expand All @@ -44,4 +46,3 @@ set_target_properties(
PROPERTIES
OUTPUT_NAME semverutil$<$<BOOL:${SEMVERUTIL_STATIC_BINARY}>:-static>
)

0 comments on commit ec12fcf

Please sign in to comment.