Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/scripts/verify-package-artifact.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
@echo off
setlocal EnableExtensions

if "%~1"=="" goto usage
if "%~2"=="" goto usage

set "ARTIFACT_DIR=%~1"
set "CONFIGURATION=%~2"

pushd "%~dp0\..\.." >nul || exit /b 1
powershell -NoLogo -NoProfile -ExecutionPolicy Bypass -File packaging\VerifyPackageArtifact.ps1 -ArtifactDirectory "%ARTIFACT_DIR%" -Configuration "%CONFIGURATION%"
set "RESULT=%errorlevel%"
popd
exit /b %RESULT%

:usage
echo Usage: %~nx0 ^<artifact-directory^> ^<Debug^|Staging^|Release^> 1>&2
exit /b 1
15 changes: 15 additions & 0 deletions .github/scripts/verify-package-artifact.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
param(
[Parameter(Mandatory = $true)]
[string]$ArtifactDirectory,

[ValidateSet('Debug', 'Staging', 'Release')]
[string]$Configuration = 'Release'
)

$ErrorActionPreference = 'Stop'
Set-StrictMode -Version Latest

$repositoryRoot = [System.IO.Path]::GetFullPath((Join-Path $PSScriptRoot '../..'))
& (Join-Path $repositoryRoot 'packaging/VerifyPackageArtifact.ps1') `
-ArtifactDirectory $ArtifactDirectory `
-Configuration $Configuration
15 changes: 15 additions & 0 deletions .github/scripts/verify-package-artifact.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env sh
set -eu

if [ "$#" -ne 2 ]; then
printf 'Usage: %s <artifact-directory> <Debug|Staging|Release>\n' "$0" >&2
exit 1
fi

script_dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
repository_root=$(CDPATH= cd -- "$script_dir/../.." && pwd)
cd "$repository_root"

pwsh -NoLogo -NoProfile -File ./packaging/VerifyPackageArtifact.ps1 \
-ArtifactDirectory "$1" \
-Configuration "$2"
73 changes: 73 additions & 0 deletions .github/workflows/distribution-validation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: distribution-validation

on:
workflow_dispatch:
inputs:
configuration:
description: Build configuration
required: true
default: Release
type: choice
options:
- Debug
- Staging
- Release

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

env:
DOTNET_VERSIONS: |
7.0.x
8.0.x
9.0.x
10.0.x

jobs:
validate:
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
name: Windows x64
verify_packages: false
- os: windows-11-arm
name: Windows ARM64
verify_packages: false
- os: ubuntu-24.04
name: Linux x64
verify_packages: true
- os: ubuntu-24.04-arm
name: Linux ARM64
verify_packages: false
- os: macos-15-intel
name: macOS x64
verify_packages: false
- os: macos-15
name: macOS ARM64
verify_packages: false
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSIONS }}
- name: Verify distribution with package validation
if: matrix.verify_packages
shell: pwsh
run: >-
./packaging/VerifyDistribution.ps1
-Configuration '${{ inputs.configuration }}'
- name: Verify build and tests
if: ${{ !matrix.verify_packages }}
shell: pwsh
run: >-
./packaging/VerifyDistribution.ps1
-Configuration '${{ inputs.configuration }}'
-SkipPackageValidation
95 changes: 95 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: main

on:
push:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

env:
DOTNET_VERSIONS: |
7.0.x
8.0.x
9.0.x
10.0.x
CONFIGURATION: Release
SOLUTION_PATH: Icod.Path.sln

jobs:
validate:
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
name: Windows x64
verify_packages: false
- os: windows-11-arm
name: Windows ARM64
verify_packages: false
- os: ubuntu-24.04
name: Linux x64
verify_packages: true
- os: ubuntu-24.04-arm
name: Linux ARM64
verify_packages: false
- os: macos-15-intel
name: macOS x64
verify_packages: false
- os: macos-15
name: macOS ARM64
verify_packages: false
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSIONS }}
- name: Restore
run: dotnet restore '${{ env.SOLUTION_PATH }}'
- name: Build
run: >-
dotnet build '${{ env.SOLUTION_PATH }}'
-c ${{ env.CONFIGURATION }}
--no-restore
-p:ContinuousIntegrationBuild=true
- name: Test
run: >-
dotnet test '${{ env.SOLUTION_PATH }}'
-c ${{ env.CONFIGURATION }}
--no-build
--no-restore
--logger trx
- name: Pack Release package
if: matrix.verify_packages
run: >-
dotnet pack '${{ env.SOLUTION_PATH }}'
-c ${{ env.CONFIGURATION }}
--no-build
--no-restore
-o artifacts
-p:ContinuousIntegrationBuild=true
- name: Verify exact Release package artifacts
if: matrix.verify_packages
shell: pwsh
run: >-
./packaging/VerifyPackageArtifact.ps1
-ArtifactDirectory artifacts
-Configuration '${{ env.CONFIGURATION }}'
- name: Upload validated Release package artifacts
if: matrix.verify_packages
uses: actions/upload-artifact@v4
with:
name: icod-path-main-packages
path: |
artifacts/*.nupkg
artifacts/*.snupkg
if-no-files-found: error
retention-days: 7
25 changes: 0 additions & 25 deletions .github/workflows/pr-build-and-test.yaml

This file was deleted.

84 changes: 84 additions & 0 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: pull-request

on:
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true

permissions:
contents: read

env:
DOTNET_VERSIONS: |
7.0.x
8.0.x
9.0.x
10.0.x
CONFIGURATION: Staging
SOLUTION_PATH: Icod.Path.sln

jobs:
validate:
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
name: Windows
verify_packages: false
- os: ubuntu-latest
name: Linux
verify_packages: true
- os: macos-latest
name: macOS
verify_packages: false
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSIONS }}
- name: Restore
run: dotnet restore '${{ env.SOLUTION_PATH }}'
- name: Build
run: >-
dotnet build '${{ env.SOLUTION_PATH }}'
-c ${{ env.CONFIGURATION }}
--no-restore
-p:ContinuousIntegrationBuild=true
- name: Test
run: >-
dotnet test '${{ env.SOLUTION_PATH }}'
-c ${{ env.CONFIGURATION }}
--no-build
--no-restore
--logger trx
- name: Pack Staging package
if: matrix.verify_packages
run: >-
dotnet pack '${{ env.SOLUTION_PATH }}'
-c ${{ env.CONFIGURATION }}
--no-build
--no-restore
-o artifacts
-p:ContinuousIntegrationBuild=true
- name: Verify exact Staging package artifacts
if: matrix.verify_packages
shell: pwsh
run: >-
./packaging/VerifyPackageArtifact.ps1
-ArtifactDirectory artifacts
-Configuration '${{ env.CONFIGURATION }}'
- name: Upload validated Staging package artifacts
if: matrix.verify_packages
uses: actions/upload-artifact@v4
with:
name: icod-path-pr-packages
path: |
artifacts/*.nupkg
artifacts/*.snupkg
if-no-files-found: error
retention-days: 7
Loading
Loading