-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add workflow to publish PowerShell module
- Loading branch information
1 parent
6d7eb0c
commit e8476fd
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow | ||
name: "Publish PowerShell module" | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
tags: | ||
- "v*.*.*" | ||
- "v*.*.*-*" | ||
|
||
jobs: | ||
publish: | ||
name: "Publish" | ||
runs-on: ubuntu-latest | ||
env: | ||
DOTNET_NOLOGO: true | ||
|
||
steps: | ||
- name: "Checkout repository" | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
|
||
- name: "Setup dotnet SDK" | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
global-json-file: global.json | ||
|
||
- name: "Install .NET tools" | ||
run: dotnet tool restore | ||
|
||
- name: "Update project files with GitVersion" | ||
run: dotnet tool run dotnet-gitversion /updateprojectfiles | ||
|
||
- name: "Pwsh: Run 'dotnet build'" | ||
run: | | ||
dotnet publish ./src/Pwsh --configuration Release --framework netstandard2.0 | ||
- name: "Publish to PowerShell Gallery" | ||
shell: pwsh | ||
run: | | ||
Publish-Module -Path "./artifacts/powershell/release/SmallsOnline.Subnetting.Pwsh/" -NuGetApiKey "${{ secrets.POWERSHELL_GALLERY_PUBLISH_KEY }}" -Repository "PSGallery" -Verbose |