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
12 changes: 12 additions & 0 deletions .github/scripts/verify-package-artifact.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
@echo off
setlocal EnableExtensions
if "%~1"=="" goto usage
if "%~2"=="" goto usage
pushd "%~dp0\..\.." >nul || exit /b 1
powershell -NoLogo -NoProfile -ExecutionPolicy Bypass -File packaging\VerifyPackageArtifact.ps1 -ArtifactDirectory "%~1" -Configuration "%~2"
set "RESULT=%errorlevel%"
popd
exit /b %RESULT%
:usage
echo Usage: %~nx0 ^<artifact-directory^> ^<Debug^|Staging^|Release^> 1>&2
exit /b 1
8 changes: 8 additions & 0 deletions .github/scripts/verify-package-artifact.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
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
10 changes: 10 additions & 0 deletions .github/scripts/verify-package-artifact.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/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"
47 changes: 47 additions & 0 deletions .github/workflows/distribution-validation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: distribution-validation

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

permissions:
contents: read

jobs:
validate:
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
name: Windows x64
- os: windows-11-arm
name: Windows ARM64
- os: ubuntu-24.04
name: Linux x64
- os: ubuntu-24.04-arm
name: Linux ARM64
- os: macos-15-intel
name: macOS x64
- os: macos-15
name: macOS ARM64
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: |
7.0.x
8.0.x
9.0.x
10.0.x
- name: Verify distribution
shell: pwsh
run: ./packaging/VerifyDistribution.ps1 -Configuration '${{ inputs.configuration }}'
72 changes: 72 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: main

on:
push:
branches:
- main

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

permissions:
contents: read

env:
CONFIGURATION: Release

jobs:
validate:
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
name: Windows x64
package: false
- os: windows-11-arm
name: Windows ARM64
package: false
- os: ubuntu-24.04
name: Linux x64
package: true
- os: ubuntu-24.04-arm
name: Linux ARM64
package: false
- os: macos-15-intel
name: macOS x64
package: false
- os: macos-15
name: macOS ARM64
package: false
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: |
7.0.x
8.0.x
9.0.x
10.0.x
- run: dotnet restore Icod.Timing.sln
- run: dotnet build Icod.Timing.sln -c ${{ env.CONFIGURATION }} --no-restore -p:ContinuousIntegrationBuild=true
- run: dotnet test Icod.Timing.sln -c ${{ env.CONFIGURATION }} --no-build --no-restore --logger trx
- name: Pack Release package
if: matrix.package
run: dotnet pack Icod.Timing.csproj -c ${{ env.CONFIGURATION }} --no-build --no-restore -o artifacts -p:ContinuousIntegrationBuild=true
- name: Verify exact Release package artifacts
if: matrix.package
shell: pwsh
run: ./packaging/VerifyPackageArtifact.ps1 -ArtifactDirectory artifacts -Configuration '${{ env.CONFIGURATION }}'
- name: Upload validated Release package artifacts
if: matrix.package
uses: actions/upload-artifact@v4
with:
name: icod-timing-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.

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

on:
pull_request:

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

permissions:
contents: read

env:
CONFIGURATION: Staging

jobs:
validate:
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
name: Windows
package: false
- os: ubuntu-latest
name: Linux
package: true
- os: macos-latest
name: macOS
package: false
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: |
7.0.x
8.0.x
9.0.x
10.0.x
- run: dotnet restore Icod.Timing.sln
- run: dotnet build Icod.Timing.sln -c ${{ env.CONFIGURATION }} --no-restore -p:ContinuousIntegrationBuild=true
- run: dotnet test Icod.Timing.sln -c ${{ env.CONFIGURATION }} --no-build --no-restore --logger trx
- name: Pack Staging package
if: matrix.package
run: dotnet pack Icod.Timing.csproj -c ${{ env.CONFIGURATION }} --no-build --no-restore -o artifacts -p:ContinuousIntegrationBuild=true
- name: Verify exact Staging package artifacts
if: matrix.package
shell: pwsh
run: ./packaging/VerifyPackageArtifact.ps1 -ArtifactDirectory artifacts -Configuration '${{ env.CONFIGURATION }}'
- name: Upload validated Staging package artifacts
if: matrix.package
uses: actions/upload-artifact@v4
with:
name: icod-timing-pr-packages
path: |
artifacts/*.nupkg
artifacts/*.snupkg
if-no-files-found: error
retention-days: 7
91 changes: 0 additions & 91 deletions .github/workflows/push-main.yaml

This file was deleted.

Loading
Loading