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 2430952
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 1 deletion.
45 changes: 45 additions & 0 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Publish release

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
- macos-14
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}}/build-${{ matrix.os }}
run: ctest -C ${{ env.BUILD_TYPE }} --output-on-failure
- name: Upload
uses: actions/upload-artifact@v4
with:
name: dist-${{ matrix.os }}
path: |
build-${{ matrix.os }}/src/semverutil*
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
cmake_minimum_required(VERSION 3.22)

if (APPLE)
set(CMAKE_OSX_ARCHTECTURES "arm64;x86_64")
endif ()

file(READ ".versioning/current" current_version)
string(STRIP "${current_version}" current_version)

Expand Down
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 APPLE)
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 2430952

Please sign in to comment.