Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
d57cf9a
+ gray-ish color for event nodes; node size is 8 by default
eosfor Jun 26, 2025
ea8d4ba
+ pester tests step
eosfor Jun 26, 2025
e6d746b
remove some folders from build
eosfor Jun 26, 2025
51b320d
update publish workflow
eosfor Jun 26, 2025
71b007c
troubleshooting pester tests
eosfor Jun 26, 2025
42e607b
more troubleshooting
eosfor Jun 27, 2025
b7e78ab
still troubleshooting
eosfor Jun 27, 2025
8120e5c
trying to fix tests to run on github actions
eosfor Jun 27, 2025
3b9e79d
another test
eosfor Jun 27, 2025
7fa9e1a
one more test
eosfor Jun 27, 2025
8a0c01b
few more tests
eosfor Jun 27, 2025
1f8c02a
another attempt
eosfor Jun 27, 2025
2bbca96
try again
eosfor Jun 27, 2025
107803d
few more updates to the workflow
eosfor Jun 27, 2025
2479502
+ pipeline for publishig common library
eosfor Jul 29, 2025
54f3405
bump minor version for testing
eosfor Jul 29, 2025
6d21989
fixing version suffix
eosfor Jul 29, 2025
f19c804
new publish pipeline
eosfor Jul 29, 2025
c75e83a
fix some issues with the pipeline
eosfor Jul 29, 2025
597be65
few more fixes as 'v' in front of a version cannot be converted to Sy…
eosfor Jul 29, 2025
9d58d6a
keep fixing version processing for PS anifest
eosfor Jul 29, 2025
4ef2824
disable auto-start by now
eosfor Jul 29, 2025
ce9b43f
keep fighting with version
eosfor Jul 29, 2025
f2a3ad3
was failing to load .net sdk. setting it up
eosfor Jul 29, 2025
a08188e
update powershell version on the runner
eosfor Jul 29, 2025
93c4d29
make sure we have correct suffix
eosfor Jul 29, 2025
7af9cea
ci: update module version to 2.3.1
github-actions[bot] Jul 29, 2025
6858d36
combining common package and module publishing
eosfor Jul 29, 2025
35727a7
Merge branch 'dev' of https://github.com/eosfor/PSGraph into dev
eosfor Jul 29, 2025
9ca5a6b
ci: update module version to 2.3.1
github-actions[bot] Jul 29, 2025
a8bfbb0
fixing issues with wrong suffux of a .net package
eosfor Jul 29, 2025
34b751d
Merge branch 'dev' of https://github.com/eosfor/PSGraph into dev
eosfor Jul 29, 2025
eed3b9e
ci: update module version to 2.3.1
github-actions[bot] Jul 29, 2025
db4105e
sync module version and common package version for simplicity
eosfor Jul 29, 2025
7efa507
Merge branch 'dev' of https://github.com/eosfor/PSGraph into dev
eosfor Jul 29, 2025
b9daa2a
another attempt
eosfor Jul 29, 2025
886417e
fix syntax
eosfor Jul 29, 2025
4be7c52
ci: update module version to 2.3.1
github-actions[bot] Jul 29, 2025
964c939
Merge branch 'master' into dev
eosfor Jul 29, 2025
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
156 changes: 146 additions & 10 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,175 @@ name: psgraph-publish
on:
release:
types: [published]

workflow_dispatch:

jobs:

publish:
runs-on: ubuntu-latest
strategy:
matrix:
dotnet-version: ['9.0.x' ]
dotnet-version: ['9.0.x']

steps:
- uses: actions/checkout@v3
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup .NET Core SDK ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.dotnet-version }}

- name: Install PowerShell
uses: PSModule/install-powershell@v1
with:
Version: latest

# --- PowerShell Module Versioning ---
- name: Ensure release tag exists
id: ensure_tag
run: |
if [ -z "${GITHUB_REF##refs/tags/}" ]; then
echo "Error: Release must have a tag."
exit 1
fi

- name: Extract version from tag and update module manifest
id: set_version
shell: pwsh
run: |
$tag = "${env:GITHUB_REF}" -replace '^refs/tags/', ''
if (-not $tag) {
Write-Error "Tag not found. Failing."
exit 1
}
$tag = $tag -replace '^v', ''
if ($tag -match '^([0-9]+\.[0-9]+\.[0-9]+)(?:-([A-Za-z0-9\-]+))?$') {
$version = $matches[1]
$prerelease = $matches[2]
} else {
Write-Error "Tag format invalid. Should be X.Y.Z or X.Y.Z-suffix"
exit 1
}
if ($prerelease -and ($prerelease -notmatch '^(?:-)?[a-zA-Z0-9\-]+$')) {
Write-Error "Prerelease string '$prerelease' contains invalid characters. Only a-z, A-Z, 0-9, and hyphen (-) at the beginning are allowed."
exit 1
}
$psd1 = Get-Item ./PSGraph/PSQuickGraph.psd1
if (-not $psd1) {
Write-Error "Module manifest (.psd1) not found!"
exit 1
}
$content = Get-Content $psd1.FullName
$versionPattern = 'ModuleVersion\s*=\s*''[^'']*'''
$content = $content -replace $versionPattern, "ModuleVersion = '$version'"
if ($prerelease) {
$content = $content -replace '^\s*#\s*Prerelease\s*=\s*''[^'']*''', "Prerelease = '$prerelease'"
}
Set-Content -Path $psd1.FullName -Value $content
"version=$version" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
"prerelease=$prerelease" | Out-File -FilePath $env:GITHUB_OUTPUT -Append

# --- PowerShell Module Build/Test/Publish ---
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build
- name: Test

- name: Build PowerShell module
run: |
if [ "${{ github.event.release.prerelease }}" = "true" ]; then
dotnet build -c Debug
else
dotnet build -c Release
fi

- name: Run .NET tests
run: dotnet test --verbosity normal

- name: Pester tests
shell: pwsh
run: |
Invoke-Pester -Path ./PsGraph.Pester.Tests/

- name: dotnet publish
run: dotnet publish -o "./PSQuickGraph"

- name: psgallery publish
run: |
$env:GITHUB_WORKSPACE
Publish-Module -Path "./PSQuickGraph" -NuGetApiKey ${{ secrets.PS_GALLERY_SECRET }}
Invoke-Pester -Path ./PsGraph.Pester.Tests/

- name: dotnet publish PowerShell module
run: |
if [ "${{ github.event.release.prerelease }}" = "true" ]; then
dotnet publish -c Debug -o "./PSQuickGraph"
else
dotnet publish -c Release -o "./PSQuickGraph"
fi

- name: Publish PowerShell module to PSGallery
shell: pwsh

run: |
Publish-Module -Path "./PSQuickGraph" -NuGetApiKey ${{ secrets.PS_GALLERY_SECRET }}

# --- NuGet Common Package Build/Publish ---
- name: Set Version Suffix for Pre-release (Common)
if: github.event.release.prerelease == true
run: |
echo "VERSION_SUFFIX=${{ steps.set_version.outputs.prerelease }}" >> $GITHUB_ENV

- name: Build PSGraph.Common (Debug on prerelease, Release on release)
run: |
if [ "${{ github.event.release.prerelease }}" = "true" ]; then
dotnet build PSGraph.Common/PSGraph.Common.csproj --configuration Debug --no-restore
else
dotnet build PSGraph.Common/PSGraph.Common.csproj --configuration Release --no-restore
fi

- name: Pack PSGraph.Common (Debug/pre-release on prerelease, Release on release)
shell: bash
run: |
if [ "${{ github.event.release.prerelease }}" = "true" ]; then
VERSION="${{ steps.set_version.outputs.version }}-${{ steps.set_version.outputs.prerelease }}"
dotnet pack PSGraph.Common/PSGraph.Common.csproj \
--configuration Debug \
--no-build \
--output ./nupkg \
/p:PackageVersion="$VERSION"
else
VERSION="${{ steps.set_version.outputs.version }}"
dotnet pack PSGraph.Common/PSGraph.Common.csproj \
--configuration Release \
--no-build \
--output ./nupkg \
/p:PackageVersion="$VERSION"
fi

- name: Publish PSGraph.Common to NuGet
run: dotnet nuget push ./nupkg/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}

# --- Commit manifest changes ---
- name: Commit and push updated manifest
if: success()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
SOURCE_BRANCH="${{ github.event.release.target_commitish }}"
if [ -z "$SOURCE_BRANCH" ]; then
echo "Could not determine source branch. Exiting."
exit 1
fi
if [[ "$SOURCE_BRANCH" =~ ^[0-9a-f]{40}$ ]]; then
echo "Commitish is a SHA, not a branch name. Aborting."
exit 1
fi
git fetch origin "$SOURCE_BRANCH"
git switch "$SOURCE_BRANCH"
git pull origin "$SOURCE_BRANCH"
git add ./PSQuickGraph/*.psd1
git commit -m "ci: update module version to ${{ steps.set_version.outputs.version }}" || echo "Nothing to commit"
git push origin "$SOURCE_BRANCH"
54 changes: 54 additions & 0 deletions .github/workflows/publishCommon.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Publish PSGraph.Common NuGet Package

on:
workflow_dispatch:

jobs:
build-and-publish:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'

- name: Restore dependencies
run: dotnet restore PSGraph.Common/PSGraph.Common.csproj

- name: Set Version Suffix for Pre-release
if: github.ref == 'refs/heads/dev'
run: |
VERSION_SUFFIX="beta-$(date +%Y%m%d%H%M%S)"
echo "VERSION_SUFFIX=$VERSION_SUFFIX" >> $GITHUB_ENV

- name: Build (Debug on dev, Release on main)
run: |
if [ "${{ github.ref }}" = "refs/heads/dev" ]; then
dotnet build PSGraph.Common/PSGraph.Common.csproj --configuration Debug --no-restore
else
dotnet build PSGraph.Common/PSGraph.Common.csproj --configuration Release --no-restore
fi

- name: Pack (Debug/pre-release on dev, Release on main)
run: |
if [ "${{ github.ref }}" = "refs/heads/dev" ]; then
dotnet pack PSGraph.Common/PSGraph.Common.csproj \
--configuration Debug \
--no-build \
--output ./nupkg \
--version-suffix $VERSION_SUFFIX
else
dotnet pack PSGraph.Common/PSGraph.Common.csproj \
--configuration Release \
--no-build \
--output ./nupkg
fi

- name: Publish to NuGet
run: dotnet nuget push ./nupkg/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
2 changes: 1 addition & 1 deletion PSGraph.Common/PSGraph.Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>1.0.1</Version>
<VersionPrefix>1.0.3</VersionPrefix>
<Authors>Andrey Vernigora</Authors>
<PackageId>PSGraph.Common</PackageId>
<Description>Common types of PSGraph module</Description>
Expand Down
123 changes: 123 additions & 0 deletions PSQuickGraph/PSQuickGraph.psd1
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
#
# Module manifest for module 'PSGraph'
#
# Generated by: Andrei
#
# Generated on: 07.04.2017
#

@{

# Script module or binary module file associated with this manifest.
RootModule = "PSGraph.dll"

# Version number of this module.
ModuleVersion = '2.3.1'

# Supported PSEditions
# CompatiblePSEditions = @()

# ID used to uniquely identify this module
GUID = '4bd5a906-8e03-497e-80eb-209e71caae45'

# Author of this module
Author = 'Andrey Vernigora'

# Company or vendor of this module
CompanyName = 'Unknown'

# Copyright statement for this module
Copyright = '(c) 2017 Andrei. All rights reserved.'

# Description of the functionality provided by this module
Description = 'This module is a wrapper for QuickGraph library.'

# Minimum version of the Windows PowerShell engine required by this module
# PowerShellVersion = ''

# Name of the Windows PowerShell host required by this module
# PowerShellHostName = ''

# Minimum version of the Windows PowerShell host required by this module
# PowerShellHostVersion = ''

# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
# DotNetFrameworkVersion = ''

# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
# CLRVersion = ''

# Processor architecture (None, X86, Amd64) required by this module
# ProcessorArchitecture = ''

# Modules that must be imported into the global environment prior to importing this module
RequiredModules = @()

# Assemblies that must be loaded prior to importing this module
# RequiredAssemblies = @("QuickGraph.dll", "QuickGraph.Data.dll", "QuickGraph.Graphviz.dll", "QuickGraph.Serialization.dll", "GraphSharp.dll", "GraphSharp.Controls.dll")
RequiredAssemblies = @()

# Script files (.ps1) that are run in the caller's environment prior to importing this module.
# ScriptsToProcess = @()

# Type files (.ps1xml) to be loaded when importing this module
# TypesToProcess = @()

# Format files (.ps1xml) to be loaded when importing this module
# FormatsToProcess = @()

# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
# NestedModules = @()

# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
FunctionsToExport = @()

# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
CmdletsToExport = @("*")

# Variables to export from this module
VariablesToExport = '*'

# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export.
AliasesToExport = @()

# DSC resources to export from this module
# DscResourcesToExport = @()

# List of all modules packaged with this module
# ModuleList = @()

# List of all files packaged with this module
# FileList = @()

# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.
PrivateData = @{

PSData = @{
Prerelease = 'beta6'
# Tags applied to this module. These help with module discovery in online galleries.
# Tags = @()

# A URL to the license for this module.
# LicenseUri = ''

# A URL to the main website for this project.
ProjectUri = 'https://github.com/eosfor/PSGraph'

# A URL to an icon representing this module.
# IconUri = ''

# ReleaseNotes of this module
# ReleaseNotes = ''

} # End of PSData hashtable

} # End of PrivateData hashtable

# HelpInfo URI of this module
# HelpInfoURI = ''

# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
# DefaultCommandPrefix = ''

}
Loading