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
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ jobs:
- uses: actions/checkout@v1
- name: Build
run: ./build.ps1 -Force
- uses: actions/upload-artifact@v1
- uses: actions/upload-artifact@v4
if: matrix.os == 'windows-latest'
with:
name: ImpliedReflection
path: ./Release/ImpliedReflection
- uses: actions/upload-artifact@v1
- uses: actions/upload-artifact@v4
if: matrix.os != 'windows-latest'
with:
name: ImpliedReflection-${{ matrix.os }}
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: publish
on:
release:
types: [ published ]

env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
POWERSHELL_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: true


defaults:
run:
shell: pwsh

jobs:
build:
name: Publish
runs-on: windows-latest
steps:
- uses: actions/checkout@v1
- name: Test and Build
run: ./build.ps1 -Force -Publish -Configuration Release
env:
GALLERY_API_KEY: ${{ secrets.GALLERY_API_KEY }}
22 changes: 18 additions & 4 deletions ImpliedReflection.build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ param(

[string[]] $Framework,

[string[]] $PowerShellVersion = ('5.1', '7.2.0')
[string[]] $PowerShellVersion = ('5.1', '7.4.12'),

[switch] $Force
)

$moduleName = 'ImpliedReflection'
Expand Down Expand Up @@ -174,12 +176,24 @@ task DoInstall {
}

task DoPublish {
if (-not (Test-Path $env:USERPROFILE\.PSGallery\apikey.xml)) {
if ($Configuration -eq 'Debug') {
throw 'Configuration must not be Debug to publish!'
}

if ($env:GALLERY_API_KEY) {
$apiKey = $env:GALLERY_API_KEY
} else {
$userProfile = [Environment]::GetFolderPath([Environment+SpecialFolder]::UserProfile)
if (Test-Path $userProfile/.PSGallery/apikey.xml) {
$apiKey = (Import-Clixml $userProfile/.PSGallery/apikey.xml).GetNetworkCredential().Password
}
}

if (-not $apiKey) {
throw 'Could not find PSGallery API key!'
}

$apiKey = (Import-Clixml $env:USERPROFILE\.PSGallery\apikey.xml).GetNetworkCredential().Password
Publish-Module -Name $Folders.Release -NuGetApiKey $apiKey -Confirm
Publish-Module -Name $Folders.Release -NuGetApiKey $apiKey -Force:$Force.IsPresent -WhatIf
}

task AssertSMA {
Expand Down
18 changes: 15 additions & 3 deletions build.ps1
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
[CmdletBinding()]
param(
[switch] $Force
[ValidateSet('Debug', 'Release')]
[string] $Configuration = 'Release',

[Parameter()]
[switch] $Force,

[Parameter()]
[switch] $Publish
)
end {
& "$PSScriptRoot\tools\AssertRequiredModule.ps1" InvokeBuild 5.8.4 -Force
& "$PSScriptRoot\tools\AssertRequiredModule.ps1" InvokeBuild 5.12.2 -Force
$invokeBuildSplat = @{
Task = 'Build'
File = "$PSScriptRoot/ImpliedReflection.build.ps1"
Configuration = 'Release'
Force = $Force.IsPresent
Configuration = $Configuration
}

if ($Publish) {
$invokeBuildSplat['Task'] = 'Publish'
}

Invoke-Build @invokeBuildSplat
Expand Down
6 changes: 4 additions & 2 deletions module/ImpliedReflection.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
RootModule = 'ImpliedReflection.psm1'

# Version number of this module.
ModuleVersion = '1.0.0'
ModuleVersion = '1.0.1'

# ID used to uniquely identify this module
GUID = '8834a5bf-9bf2-4f09-8415-3c1e561109f6'
Expand Down Expand Up @@ -75,7 +75,9 @@ PrivateData = @{
# IconUri = ''

# ReleaseNotes of this module
ReleaseNotes = '# v1.0.0
ReleaseNotes = '# v1.0.1
- Updated Harmony, should work in up to PowerShell v7.6
# v1.0.0
- Now just works after enabling.'

} # End of PSData hashtable
Expand Down
14 changes: 7 additions & 7 deletions src/ImpliedReflection/ImpliedReflection.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

<PropertyGroup>
<TargetFrameworks Condition=" '$(ExtraFrameworks)' != '' ">$(TargetFrameworks);$(ExtraFrameworks)</TargetFrameworks>
<TargetFrameworks>net471;net6</TargetFrameworks>
<!-- <TargetFrameworks>net6;net471</TargetFrameworks> -->
<TargetFrameworks>net471;net8</TargetFrameworks>
<!-- <TargetFrameworks>net8;net471</TargetFrameworks> -->
<InternalsAssemblyNames>System.Management.Automation</InternalsAssemblyNames>
<LangVersion>latest</LangVersion>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
Expand All @@ -14,9 +14,9 @@
<DefineConstants Condition=" '$(ExtraConstants)' != '' ">$(DefineConstants);$(ExtraConstants)</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'net6' ">
<PropertyGroup Condition=" '$(TargetFramework)' == 'net8' ">
<DefineConstants>$(DefineConstants);PS7</DefineConstants>
<SMAVersion>7.2.0</SMAVersion>
<SMAVersion>7.4.12</SMAVersion>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'net471' ">
Expand All @@ -43,8 +43,8 @@
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net471' ">
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="5.0.0" />
<PackageReference Include="System.Collections.Immutable" Version="5.0.0" />
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.1.2" />
<PackageReference Include="System.Collections.Immutable" Version="9.0.9" />
</ItemGroup>

<ItemGroup>
Expand All @@ -60,7 +60,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Lib.Harmony" Version="2.2.0" />
<PackageReference Include="Lib.Harmony" Version="2.4.2" />
</ItemGroup>


Expand Down