From 9d6cad60fe4851352277e514f22f4ef536b35a6b Mon Sep 17 00:00:00 2001 From: Leonard Jonathan Oh Date: Sun, 16 Jun 2024 18:04:58 +0000 Subject: [PATCH] Enhancement (ci): Bump PSModulePublisher to v0.8.1 --- .github/workflows/ci-master-pr.yml | 21 ++++++--------------- .vscode/tasks.json | 6 +++--- build/PSModulePublisher | 2 +- 3 files changed, 10 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci-master-pr.yml b/.github/workflows/ci-master-pr.yml index 4fe3644..3f85826 100644 --- a/.github/workflows/ci-master-pr.yml +++ b/.github/workflows/ci-master-pr.yml @@ -169,12 +169,9 @@ jobs: NUGET_API_KEY: 'xxx' run: | $ErrorActionPreference = 'Stop' - - # Generate the new module manifest - $moduleManifest = ./build/PSModulePublisher/src/PSModulePublisher/Public/Invoke-Build.ps1 - - # Publish the module - ./build/PSModulePublisher/src/PSModulePublisher/Public/Invoke-Publish.ps1 -ModuleManifestPath $moduleManifest -Repository PSGallery -DryRun + Import-Module ./build/PSModulePublisher/src/PSModulePublisher -Force + $moduleManifest = Invoke-Build + Invoke-Publish -ModuleManifestPath $moduleManifest -Repository PSGallery -DryRun publish-to-psgallery: needs: @@ -203,15 +200,9 @@ jobs: NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} run: | $ErrorActionPreference = 'Stop' - - # Strip of 'v' prefix from tag - $env:MODULE_VERSION = $env:GITHUB_REF_NAME -replace '^v', '' - - # Generate the new module manifest - $moduleManifest = ./build/PSModulePublisher/src/PSModulePublisher/Public/Invoke-Build.ps1 - - # Publish the module - ./build/PSModulePublisher/src/PSModulePublisher/Public/Invoke-Publish.ps1 -ModuleManifestPath $moduleManifest -Repository PSGallery + Import-Module ./build/PSModulePublisher/src/PSModulePublisher -Force + $moduleManifest = Invoke-Build + Invoke-Publish -ModuleManifestPath $moduleManifest -Repository PSGallery publish-draft-release: needs: [publish-to-psgallery] diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 82c2e27..daa951c 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -32,7 +32,7 @@ { "label": "Build: Generate module manifest", "type": "shell", - "command": "MODULE_VERSION=${input:MODULE_VERSION} pwsh build/PSModulePublisher/src/PSModulePublisher/Public/Invoke-Build.ps1", + "command": "MODULE_VERSION=${input:MODULE_VERSION} pwsh -Command '$ErrorActionPreference = \"Stop\"; Import-Module ./build/PSModulePublisher/src/PSModulePublisher -Force; $moduleManifest = Invoke-Build'", "group": "build" }, { @@ -41,7 +41,7 @@ "Build: Generate module manifest" ], "type": "shell", - "command": "MODULE_NAME=$(basename $(pwd)); NUGET_API_KEY=${input:NUGET_API_KEY} MODULE_VERSION=${input:MODULE_VERSION} pwsh build/PSModulePublisher/src/PSModulePublisher/Public/Invoke-Publish.ps1 -ModuleManifestPath src/$MODULE_NAME/$MODULE_NAME.psd1 -Repository PSGallery -DryRun", + "command": "NUGET_API_KEY=${input:NUGET_API_KEY} MODULE_VERSION=${input:MODULE_VERSION} pwsh -Command '$ErrorActionPreference = \"Stop\"; Import-Module ./build/PSModulePublisher/src/PSModulePublisher -Force; $moduleManifest = Invoke-Build; Invoke-Publish -ModuleManifestPath $moduleManifest -Repository PSGallery -DryRun'", "group": "build" }, { @@ -50,7 +50,7 @@ "Build: Generate module manifest" ], "type": "shell", - "command": "MODULE_NAME=$(basename $(pwd)); NUGET_API_KEY=${input:NUGET_API_KEY} MODULE_VERSION=${input:MODULE_VERSION} pwsh build/PSModulePublisher/src/PSModulePublisher/Public/Invoke-Publish.ps1 -ModuleManifestPath src/$MODULE_NAME/$MODULE_NAME.psd1 -Repository PSGallery", + "command": "NUGET_API_KEY=${input:NUGET_API_KEY} MODULE_VERSION=${input:MODULE_VERSION} pwsh -Command '$ErrorActionPreference = \"Stop\"; Import-Module ./build/PSModulePublisher/src/PSModulePublisher -Force; $moduleManifest = Invoke-Build; Invoke-Publish -ModuleManifestPath $moduleManifest -Repository PSGallery'", "group": "build" }, diff --git a/build/PSModulePublisher b/build/PSModulePublisher index f981361..53bdbf4 160000 --- a/build/PSModulePublisher +++ b/build/PSModulePublisher @@ -1 +1 @@ -Subproject commit f981361938ec2848057aade59308757c29d11d57 +Subproject commit 53bdbf413859baaea67e811f05f7a495cd9da492