Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

- fixes workflow so we only release preview images when we find entries in release notes so it's aligned with ADO #3319

Merged
merged 3 commits into from
Sep 18, 2023
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
8 changes: 4 additions & 4 deletions .azure-pipelines/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,11 @@ stages:
- pwsh: $(Build.SourcesDirectory)/scripts/get-version-from-csproj.ps1
displayName: "Get Kiota's version-number from .csproj"

- pwsh: $(Build.SourcesDirectory)/scripts/get-release-notes.ps1 -version $(artifactVersion) -check
- pwsh: $(Build.SourcesDirectory)/scripts/get-release-notes.ps1 -version $(artifactVersion)
condition: eq(variables['isPrerelease'], 'false')
displayName: "Get release notes from CHANGELOG.md"

- pwsh: $(Build.SourcesDirectory)/scripts/get-release-notes.ps1 -version Unreleased -check
- pwsh: $(Build.SourcesDirectory)/scripts/get-release-notes.ps1 -version Unreleased
condition: eq(variables['isPrerelease'], 'true')

# Build the Product project
Expand Down Expand Up @@ -600,10 +600,10 @@ stages:
displayName: "Set version suffix"
- pwsh: $(Build.SourcesDirectory)/scripts/get-version-from-csproj.ps1
displayName: "Get Kiota's version-number from .csproj"
- pwsh: $(Build.SourcesDirectory)/scripts/get-release-notes.ps1 -version $(artifactVersion)
- pwsh: $(Build.SourcesDirectory)/scripts/get-release-notes.ps1 -version $(artifactVersion) -createNotes
condition: eq(variables['isPrerelease'], 'false')
displayName: "Get release notes from CHANGELOG.md"
- pwsh: $(Build.SourcesDirectory)/scripts/get-release-notes.ps1 -version Unreleased
- pwsh: $(Build.SourcesDirectory)/scripts/get-release-notes.ps1 -version Unreleased -createNotes
condition: eq(variables['isPrerelease'], 'true')
displayName: "Get release notes from CHANGELOG.md"
- task: GitHubRelease@1
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,16 @@ jobs:
shell: pwsh
name: "Get Kiota's version-number from .csproj"

- run: ./scripts/get-release-notes.ps1 -version "${{ steps.getversion.outputs.version }}"
if: ${{!contains(github.ref, env.PREVIEW_BRANCH)}}
name: "Get release notes from CHANGELOG.md"
shell: pwsh

- run: ./scripts/get-release-notes.ps1 -version Unreleased
if: contains(github.ref, env.PREVIEW_BRANCH)
name: "Get release notes from CHANGELOG.md"
shell: pwsh

- run: ./scripts/update-versions.ps1
shell: pwsh
name: "Update dependencies versions"
Expand Down
4 changes: 2 additions & 2 deletions scripts/get-release-notes.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ param (
$version,
[switch]
[bool]
$check
$createNotes
)

$version = $version.TrimStart("v")
Expand All @@ -23,7 +23,7 @@ $releaseNotes = $changeLogContent.Substring($headerLineNumber, $endLineNumber -
if ($version -eq "Unreleased" -and [string]::IsNullOrWhiteSpace($releaseNotes.Replace("### Changed", "").Replace("### Added", ""))) {
throw "Version $version not found in CHANGELOG.md make sure you've updated the changelog"
}
if ($check -eq $false) {
if ($createNotes -eq $true) {
$targetFile = Join-Path (Split-Path $changelogPath -Parent) "release-notes.txt"
Set-Content -Path $targetFile -Value $releaseNotes -Verbose
}
Loading