Skip to content

Commit 54ac232

Browse files
authored
Merge pull request #2 from adamdriscoll/master
Add build and release. Add tests.
2 parents 734606a + 1748882 commit 54ac232

File tree

7 files changed

+360
-151
lines changed

7 files changed

+360
-151
lines changed

.github/workflows/ci-cd.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: CI/CD
2+
3+
on:
4+
push:
5+
branches: [ master, main ]
6+
pull_request:
7+
branches: [ master, main ]
8+
release:
9+
types: [ published ]
10+
11+
jobs:
12+
build:
13+
runs-on: windows-latest
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Setup .NET
19+
uses: actions/setup-dotnet@v4
20+
with:
21+
dotnet-version: '6.0.x'
22+
23+
- name: Restore dependencies
24+
run: dotnet restore
25+
26+
- name: Build
27+
run: dotnet build --configuration Release --no-restore
28+
29+
- name: Run Pester tests
30+
shell: pwsh
31+
run: |
32+
Install-Module -Name Pester -Force -SkipPublisherCheck -Scope CurrentUser
33+
Invoke-Pester -Path .\Tests\FindOpenFile.Tests.ps1 -Output Detailed -Configuration @{ Run = @{ Container = New-PesterContainer -Path .\Tests\FindOpenFile.Tests.ps1 -Data @{ Configuration = 'Release' } } }
34+
35+
- name: Upload build artifacts
36+
uses: actions/upload-artifact@v4
37+
with:
38+
name: module
39+
path: bin/Release/netstandard2.0/
40+
41+
publish:
42+
needs: build
43+
runs-on: windows-latest
44+
if: github.event_name == 'release'
45+
46+
steps:
47+
- uses: actions/checkout@v4
48+
49+
- name: Setup .NET
50+
uses: actions/setup-dotnet@v4
51+
with:
52+
dotnet-version: '6.0.x'
53+
54+
- name: Build Release
55+
run: dotnet build --configuration Release
56+
57+
- name: Publish to PowerShell Gallery
58+
shell: pwsh
59+
env:
60+
PSGALLERY_API_KEY: ${{ secrets.PSGALLERY_API_KEY }}
61+
run: |
62+
$modulePath = ".\bin\Release\netstandard2.0"
63+
Publish-Module -Path $modulePath -NuGetApiKey $env:PSGALLERY_API_KEY -Verbose

FindOpenFile.psd1

Lines changed: 16 additions & 129 deletions
Original file line numberDiff line numberDiff line change
@@ -1,132 +1,19 @@
1-
#
2-
# Module manifest for module 'FindOpenFile'
3-
#
4-
# Generated by: Adam Driscoll
5-
#
6-
# Generated on: 5/31/2020
7-
#
8-
91
@{
10-
11-
# Script module or binary module file associated with this manifest.
12-
RootModule = 'findopenfiles.dll'
13-
14-
# Version number of this module.
15-
ModuleVersion = '1.0.1'
16-
17-
# Supported PSEditions
18-
# CompatiblePSEditions = @()
19-
20-
# ID used to uniquely identify this module
21-
GUID = 'ed3d6408-fe70-40e3-adae-c43dfe1b88ae'
22-
23-
# Author of this module
24-
Author = 'Adam Driscoll'
25-
26-
# Company or vendor of this module
27-
CompanyName = 'Ironman Software'
28-
29-
# Copyright statement for this module
30-
Copyright = 'Ironman Software 2020'
31-
32-
# Description of the functionality provided by this module
33-
Description = 'Find open files on Windows with PowerShell'
34-
35-
# Minimum version of the PowerShell engine required by this module
36-
# PowerShellVersion = ''
37-
38-
# Name of the PowerShell host required by this module
39-
# PowerShellHostName = ''
40-
41-
# Minimum version of the PowerShell host required by this module
42-
# PowerShellHostVersion = ''
43-
44-
# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
45-
# DotNetFrameworkVersion = ''
46-
47-
# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
48-
# ClrVersion = ''
49-
50-
# Processor architecture (None, X86, Amd64) required by this module
51-
# ProcessorArchitecture = ''
52-
53-
# Modules that must be imported into the global environment prior to importing this module
54-
# RequiredModules = @()
55-
56-
# Assemblies that must be loaded prior to importing this module
57-
# RequiredAssemblies = @()
58-
59-
# Script files (.ps1) that are run in the caller's environment prior to importing this module.
60-
# ScriptsToProcess = @()
61-
62-
# Type files (.ps1xml) to be loaded when importing this module
63-
# TypesToProcess = @()
64-
65-
# Format files (.ps1xml) to be loaded when importing this module
66-
# FormatsToProcess = @()
67-
68-
# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
69-
# NestedModules = @()
70-
71-
# 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.
72-
FunctionsToExport = '*'
73-
74-
# 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.
75-
CmdletsToExport = 'Find-OpenFile'
76-
77-
# Variables to export from this module
78-
VariablesToExport = '*'
79-
80-
# 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.
81-
AliasesToExport = '*'
82-
83-
# DSC resources to export from this module
84-
# DscResourcesToExport = @()
85-
86-
# List of all modules packaged with this module
87-
# ModuleList = @()
88-
89-
# List of all files packaged with this module
90-
# FileList = @()
91-
92-
# 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.
93-
PrivateData = @{
94-
95-
PSData = @{
96-
97-
# Tags applied to this module. These help with module discovery in online galleries.
98-
Tags = @('windows')
99-
100-
# A URL to the license for this module.
101-
LicenseUri = 'https://github.com/ironmansoftware/findopenfiles/blob/master/LICENSE.md'
102-
103-
# A URL to the main website for this project.
104-
ProjectUri = 'https://github.com/ironmansoftware/findopenfiles'
105-
106-
# A URL to an icon representing this module.
107-
# IconUri = ''
108-
109-
# ReleaseNotes of this module
110-
ReleaseNotes = 'https://github.com/ironmansoftware/findopenfiles/blob/master/CHANGELOG.md'
111-
112-
# Prerelease string of this module
113-
# Prerelease = ''
114-
115-
# Flag to indicate whether the module requires explicit user acceptance for install/update/save
116-
# RequireLicenseAcceptance = $false
117-
118-
# External dependent modules of this module
119-
# ExternalModuleDependencies = @()
120-
121-
} # End of PSData hashtable
122-
123-
} # End of PrivateData hashtable
124-
125-
# HelpInfo URI of this module
126-
# HelpInfoURI = ''
127-
128-
# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
129-
# DefaultCommandPrefix = ''
130-
2+
RootModule = 'findopenfiles.dll'
3+
ModuleVersion = '1.0.1'
4+
GUID = 'ed3d6408-fe70-40e3-adae-c43dfe1b88ae'
5+
Author = 'Adam Driscoll'
6+
CompanyName = 'Ironman Software'
7+
Copyright = 'Ironman Software 2025'
8+
Description = 'Find open files on Windows with PowerShell'
9+
CmdletsToExport = 'Find-OpenFile'
10+
PrivateData = @{
11+
PSData = @{
12+
Tags = @('windows')
13+
LicenseUri = 'https://github.com/ironmansoftware/findopenfiles/blob/master/LICENSE.md'
14+
ProjectUri = 'https://github.com/ironmansoftware/findopenfiles'
15+
ReleaseNotes = 'https://github.com/ironmansoftware/findopenfiles/blob/master/CHANGELOG.md'
16+
}
17+
}
13118
}
13219

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2020 Ironman Software, LLC
3+
Copyright (c) 2025 Ironman Software, LLC
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

LICENSE.md

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)