Skip to content

feat: add release support #3

feat: add release support

feat: add release support #3

Workflow file for this run

name: C++ Release CI
on:
push:
tags:
- "v*.*.*"
env:
CTEST_OUTPUT_ON_FAILURE: 1
jobs:
build:
strategy:
matrix:
include:
- os: "ubuntu-24.04"
fail-fast: false
runs-on: ${{ matrix.os }}
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Cache Cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Cache vcpkg registry
if: always()
uses: actions/cache@v4
with:
path: |
build/vcpkg_installed/
build/vcpkg_packages/
key: ${{ runner.os }}-vcpkg-${{ hashFiles('./vcpkg*.json') }}
restore-keys: |
${{ runner.os }}-vcpkg-
- name: install dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
autoconf \
autoconf-archive \
automake \
build-essential \
ninja-build
- name: Install rust dependencies
run: |
cargo install wasm-tools wit-bindgen-cli || true
- name: configure
run: |
cmake --preset linux-ninja-Release
- name: build
run: |
cmake --build --preset linux-ninja-Release
- name: test
working-directory: build
run: |
ctest -VV
- name: Package
run: |
tar -czvf cmcpp-${GITHUB_REF_NAME}.tar.gz include LICENSE LICENSE-BOOST-PFR
- name: Create Release
uses: ncipollo/release-action@v1
with:
tag: ${{ github.ref_name }}
artifacts: cmcpp-${{ github.ref_name }}.tar.gz
- name: Upload error logs
if: ${{ failure() || cancelled() }}
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}-logs
path: ./**/*.log