Skip to content

Commit

Permalink
feat(ci): add publish workflow (#3)
Browse files Browse the repository at this point in the history
* update build script to handle tags

* add publish workflow
  • Loading branch information
scottmckendry authored May 23, 2024
1 parent 32fe59a commit 5dc1160
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Publish
on: release

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build and publish
env:
NUGET_KEY: ${{ secrets.NUGET_KEY }}
RELEASE_TAG: ${{ github.event.release.tag_name }}
shell: pwsh
run: |
./build.ps1 -Version $env:RELEASE_TAG
Publish-Module -Path ./ps-color-scripts -NuGetApiKey $env:NUGET_KEY -Verbose
6 changes: 6 additions & 0 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ param(
[string]$Version
)

# Remove the 'v' from the version number if its present
$version = $version -replace "v", ""

$manifestParams = @{
"ModuleVersion" = $version
"Path" = "./ps-arch-wsl/ps-arch-wsl.psd1"
Expand All @@ -18,6 +21,9 @@ $manifestParams = @{
"PassThru" = $true
}

# Copy the README.md file to the module directory
Copy-Item -Path "./README.md" -Destination "./ps-arch-wsl/README.md" -Force -ErrorAction SilentlyContinue

# Create the module manifest
Remove-Item -Path "./ps-arch-wsl/ps-arch-wsl.psd1" -Force -ErrorAction SilentlyContinue
New-ModuleManifest @manifestParams

0 comments on commit 5dc1160

Please sign in to comment.