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
2 changes: 0 additions & 2 deletions .github/workflows/pester-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ name: Pester Tests
on:
pull_request:
branches: [ main ]
push:
branches: [ main ]

jobs:
pester-tests:
Expand Down
44 changes: 9 additions & 35 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -286,45 +286,19 @@ jobs:
Write-Host "Created and pushed tag v${{ steps.version.outputs.version }}"
}

- name: Get Commit Messages for Release Notes
if: steps.run-mode.outputs.is-dry-run == 'false'
id: release-notes
shell: pwsh
run: |
# Get the previous tag
$previousTag = git describe --tags --abbrev=0 "v${{ steps.version.outputs.version }}~1" 2>$null
if ($LASTEXITCODE -ne 0) {
# If no previous tag, get last 10 commits
$commits = git log --oneline --pretty=format:"- %s (%h)" -n 10
} else {
# Get commits since the previous tag
$commits = git log --oneline --pretty=format:"- %s (%h)" "$previousTag..v${{ steps.version.outputs.version }}"
}

$releaseNotes = @"
## Changes in version ${{ steps.version.outputs.version }}

$($commits -join "`n")

## Installation
``````powershell
Install-Module -Name PSBlogger -RequiredVersion ${{ steps.version.outputs.version }}
``````
"@

# Escape for GitHub Actions
$releaseNotes = $releaseNotes -replace "`r`n", "`n" -replace "`n", "%0A"
echo "release-notes=$releaseNotes" >> $env:GITHUB_OUTPUT

- name: Create GitHub Release
if: steps.run-mode.outputs.is-dry-run == 'false'
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ steps.version.outputs.version }}
release_name: Release v${{ steps.version.outputs.version }}
body: ${{ steps.release-notes.outputs.release-notes }}
name: Release v${{ steps.version.outputs.version }}
generate_release_notes: true
append_body: true
body: |
## Installation
```powershell
Install-Module -Name PSBlogger -RequiredVersion ${{ steps.version.outputs.version }}
```
draft: false
prerelease: false

Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ A PowerShell library for publishing markdown files authored in markdown to Blogg
choco install pandoc
```

(Future: still need to publish to PowerShell nuget library)
```
Install-Module PSBlogger
```
Expand Down
2 changes: 1 addition & 1 deletion src/PSBlogger.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
RootModule = 'PSBlogger.psm1'

# Version number of this module.
ModuleVersion = '0.3.0'
ModuleVersion = '0.4.0'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down
Loading