Skip to content

feat: add wit-codegen tool (#15) #5

feat: add wit-codegen tool (#15)

feat: add wit-codegen tool (#15) #5

Workflow file for this run

name: Release
on:
push:
tags:
- "v*.*.*"
env:
CTEST_OUTPUT_ON_FAILURE: 1
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-24.04
preset: linux-ninja-Release
build-preset: linux-ninja-Release
cpack-generators: "TGZ;DEB;RPM"
package-patterns: |
build/cmcpp-*.tar.gz
build/cmcpp_*.deb
build/cmcpp-*.rpm
extra-deps: |
sudo apt-get update
sudo apt-get install -y \
autoconf \
autoconf-archive \
automake \
build-essential \
ninja-build \
rpm
- os: windows-2022
preset: vcpkg-VS-17
build-preset: VS-17-Release
cpack-generators: "ZIP;NSIS"
cpack-config: "-C Release"
package-patterns: |
build/cmcpp-*.zip
build/cmcpp-*.exe
extra-deps: ""
- os: macos-14
preset: linux-ninja-Release
build-preset: linux-ninja-Release
cpack-generators: "TGZ;ZIP"
package-patterns: |
build/cmcpp-*.tar.gz
build/cmcpp-*.zip
extra-deps: |
brew install \
pkg-config \
autoconf \
autoconf-archive \
automake \
coreutils \
libtool \
cmake \
ninja
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
if: matrix.extra-deps != ''
run: ${{ matrix.extra-deps }}
- name: Install Rust dependencies
run: |
cargo install wasm-tools wit-bindgen-cli || true
- name: Configure CMake
run: |
cmake --preset ${{ matrix.preset }}
- name: Build
run: |
cmake --build --preset ${{ matrix.build-preset }}
- name: Run Tests
working-directory: build
run: |
ctest ${{ matrix.cpack-config || '' }} -VV
- name: Create Packages
working-directory: build
run: |
IFS=';' read -ra GENS <<< "${{ matrix.cpack-generators }}"
for gen in "${GENS[@]}"; do
cpack ${{ matrix.cpack-config || '' }} -G "$gen"
done
shell: bash
- name: Upload Packages
uses: softprops/action-gh-release@v2
with:
files: ${{ matrix.package-patterns }}
fail_on_unmatched_files: false
- name: Upload error logs
if: ${{ failure() || cancelled() }}
uses: actions/upload-artifact@v4
with:
name: ${{ runner.os }}-logs
path: ./**/*.log