Skip to content

Explicitly reference Controls project rather than via matrix in CI #5

Explicitly reference Controls project rather than via matrix in CI

Explicitly reference Controls project rather than via matrix in CI #5

Workflow file for this run

name: CI
on:
workflow_dispatch:
push:
branches:
- main
jobs:
build:
name: Build
runs-on: matrix.os
strategy:
matrix:
project:
- Riverside.Markup
- Riverside.Markup.CompilerServices
- Riverside.Markup.InteropServices
# Add more projects here as needed
os: [windows-latest, ubuntu-latest, macos-latest]
outputs:
normalized_name: ${{ steps.normalize_name.outputs.normalized_name }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.x'
- name: Restore dependencies
run: dotnet restore src/${{ matrix.project }}/${{ matrix.project }}.csproj
- name: Build project
run: dotnet build src/${{ matrix.project }}/${{ matrix.project }}.csproj --configuration Release --no-restore
- name: Build project (Windows)
if: matrix.os == 'windows-latest'
run: dotnet build src/Riverside.Markup.Controls/Riverside.Markup.Controls.csproj --configuration Release --no-restore
- name: Pack project
run: dotnet pack src/${{ matrix.project }}/${{ matrix.project }}.csproj --configuration Release --no-build -o ./output
- name: Pack project (Windows)
if: matrix.os == 'windows-latest'
run: dotnet pack src/Riverside.Markup.Controls/Riverside.Markup.Controls.csproj --configuration Release --no-build -o ./output
- name: Normalize project name
id: normalize_name
run: echo "normalized_name=$(echo src/${{ matrix.project }}/${{ matrix.project }} | tr '/' '-')" >> $GITHUB_ENV
shell: bash
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: Packages
path: ./output/*.nupkg