Files
cpp-example/.github/workflows/cmake_build.yml
T
DawnMagnet 48a1faf868
CMake Build / build (push) Successful in 23s
initial commit
2025-03-22 11:03:07 +08:00

36 lines
921 B
YAML

name: CMake Build
on:
push:
tags:
- "v*"
jobs:
build:
# 可以更换为ubuntu-{24.04, 22.04, 20.04},默认为ubuntu-24.04
runs-on: ubuntu-24.04
steps:
- name: Install Dependencies
run: |
apt update
apt install -y cmake build-essential
- uses: actions/checkout@v4
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release
- name: Build Project
run: cmake --build ${{github.workspace}}/build --config Release --parallel 8
- name: Strip Binary
run: strip ${{github.workspace}}/build/cpp_example
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: ${{github.workspace}}/build/cpp_example
draft: false
prerelease: false
generate_release_notes: true
token: ${{secrets.GITHUB_TOKEN}}