Skip to content

Commit 7a5d3b1

Browse files
committed
test Release
1 parent 4a10ebd commit 7a5d3b1

File tree

2 files changed

+89
-1
lines changed

2 files changed

+89
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414

1515
strategy:
1616
# Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable.
17-
fail-fast: false
17+
fail-fast: true
1818

1919
# Set up a matrix to run the following 3 configurations:
2020
# 1. <Windows, Release, latest MSVC compiler toolchain on the default runner image, default generator>

.github/workflows/release.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: CMake on multiple platforms
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
build:
10+
runs-on: ${{ matrix.os }}
11+
12+
strategy:
13+
# Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable.
14+
fail-fast: false
15+
16+
matrix:
17+
os: [ubuntu-latest, windows-latest]
18+
build_type: [Release]
19+
c_compiler: [gcc, clang, cl]
20+
include:
21+
- os: windows-latest
22+
c_compiler: cl
23+
cpp_compiler: cl
24+
- os: ubuntu-latest
25+
c_compiler: gcc
26+
cpp_compiler: g++
27+
- os: ubuntu-latest
28+
c_compiler: clang
29+
cpp_compiler: clang++
30+
exclude:
31+
- os: windows-latest
32+
c_compiler: gcc
33+
- os: windows-latest
34+
c_compiler: clang
35+
- os: ubuntu-latest
36+
c_compiler: cl
37+
38+
steps:
39+
- uses: actions/checkout@v4
40+
41+
- name: Set reusable strings
42+
# Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file.
43+
id: strings
44+
shell: bash
45+
run: |
46+
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
47+
echo "package-name=nidb-${{ matrix.os }}-${{ matrix.build_type }}" >> "$GITHUB_OUTPUT"
48+
49+
- name: Configure CMake
50+
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
51+
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
52+
run: >
53+
cmake -B ${{ steps.strings.outputs.build-output-dir }}
54+
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
55+
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
56+
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
57+
-S ${{ github.workspace }}
58+
59+
- name: Build
60+
# Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator).
61+
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }}
62+
63+
- name: Package build artifacts
64+
run: |
65+
cd ${{ steps.strings.outputs.build-output-dir }}
66+
zip -r ${{ steps.strings.outputs.package-name }}.zip .
67+
68+
- name: Upload artifact
69+
uses: actions/upload-artifact@v4
70+
with:
71+
name: ${{ steps.strings.outputs.package-name }}
72+
path: ${{ steps.strings.outputs.build-output-dir }}/${{ steps.strings.outputs.package-name }}.zip
73+
74+
release:
75+
needs: build
76+
runs-on: ubuntu-latest
77+
78+
steps:
79+
- name: Download artifacts
80+
uses: actions/download-artifact@v4
81+
with:
82+
path: artifacts
83+
84+
- name: create-release
85+
uses: softprops/action-gh-release@v2
86+
with:
87+
token: ${{ secrets.ROCK_PUSH }}
88+
files: artifacts/*/*.zip

0 commit comments

Comments
 (0)