Skip to content

Commit d0a40a3

Browse files
authored
Update cmake-single-platform.yml
1 parent e2a2966 commit d0a40a3

File tree

1 file changed

+28
-8
lines changed

1 file changed

+28
-8
lines changed

.github/workflows/cmake-single-platform.yml

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,33 +7,53 @@ on:
77
branches: [ "main" ]
88
pull_request:
99
branches: [ "main" ]
10+
release:
11+
types: [created]
1012

1113
env:
1214
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
1315
BUILD_TYPE: Release
1416

1517
jobs:
1618
build:
17-
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
18-
# You can convert this to a matrix build if you need cross-platform coverage.
19-
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
2019
runs-on: ubuntu-latest
2120

2221
steps:
2322
- uses: actions/checkout@v4
2423

2524
- name: Configure CMake
26-
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
27-
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
2825
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
2926

3027
- name: Build
31-
# Build your program with the given configuration
3228
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
3329

3430
- name: Test
3531
working-directory: ${{github.workspace}}/build
36-
# Execute tests defined by the CMake configuration.
37-
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
3832
run: ctest -C ${{env.BUILD_TYPE}}
3933

34+
- name: Upload Build Artifacts
35+
uses: actions/upload-artifact@v3
36+
with:
37+
name: build-artifacts
38+
path: ${{github.workspace}}/build
39+
40+
release:
41+
needs: build
42+
runs-on: ubuntu-latest
43+
steps:
44+
- name: Download Build Artifacts
45+
uses: actions/download-artifact@v3
46+
with:
47+
name: build-artifacts
48+
path: ${{github.workspace}}/build
49+
50+
- name: Create GitHub Release
51+
uses: actions/create-release@v1
52+
env:
53+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54+
with:
55+
tag_name: ${{ github.ref }}
56+
release_name: "Release ${{ github.ref }}"
57+
draft: false
58+
prerelease: false
59+
files: ${{ github.workspace }}/build/**

0 commit comments

Comments
 (0)