Skip to content

Commit

Permalink
fix: Correct the build process to push release notes through for the …
Browse files Browse the repository at this point in the history
…public website
  • Loading branch information
slewis74 authored Aug 18, 2022
1 parent 822dee9 commit 8fe03ba
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 5 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches: '**'
release:
types: [published]
types: [created]
schedule:
# Daily 5am australian/brisbane time (7pm UTC)
- cron: '0 19 * * *'
Expand All @@ -14,6 +14,8 @@ jobs:
build:
name: Build and unit test code
runs-on: windows-latest
# conditionally skip build on PR merge of release-please, because the release creation is going to trigger the real build
if: ${{ github.ref_name != github.event.repository.default_branch || github.event.head_commit.author.username != 'team-integrations-fnm-bot' }}
outputs:
version: ${{ steps.nuke-build.outputs.version }}
steps:
Expand Down Expand Up @@ -245,12 +247,22 @@ jobs:
artifacts/OctopusTools.Packages.linux-x64.${{ needs.build.outputs.version }}.zip
artifacts/OctopusTools.Zips.${{ needs.build.outputs.version }}.zip
- name: Fetch Release Notes
id: fetch-release-notes
if: github.event_name == 'release'
run: |
echo "::debug::${{github.event_name}}"
OUTPUT_FILE="release_notes.txt"
jq --raw-output '.release.body' ${{ github.event_path }} | sed 's#\r# #g' > $OUTPUT_FILE
echo "::set-output name=release-note-file::$OUTPUT_FILE"
- name: Create a release in Octopus Deploy 🐙
uses: OctopusDeploy/[email protected]
with:
space: Integrations
project: 'Octopus CLI'
package_version: ${{ needs.build.outputs.version }}
packages: '*:NuGet.CommandLine:4.4.1'
git_ref: ${{ (github.ref_type == 'tag' && 'main' ) || (github.head_ref || github.ref) }}
release_notes_file: ${{ (github.event_name == 'release' && steps.fetch-release-notes.outputs.release-note-file) || ''}}
git_ref: ${{ (github.ref_type == 'tag' && github.event.repository.default_branch ) || (github.head_ref || github.ref) }}
git_commit: ${{ github.event.after || github.event.pull_request.head.sha }}
4 changes: 2 additions & 2 deletions .octopus/deployment_process.ocl
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ step "create-release-in-slipway" {
$slipwayToken = $OctopusParameters["SlipwayToken"]
$baseUrl = $OctopusParameters["SlipwayUrl"]
$version = $OctopusParameters["Octopus.Release.Number"]
$releaseNotes = $OctopusParameters["Octopus.Release.Notes"]
$releaseNotes = $OctopusParameters["Octopus.Deployment.ChangesMarkdown"]

$headers = @{ "Authorization" = "Bearer $slipwayToken" }

Expand All @@ -416,7 +416,7 @@ step "create-release-in-slipway" {
"IsPrerelease" = $isPreRelease;
"IsPublic" = $true;
"ReleaseNotes" = $releaseNotes;
"ReleaseNotesMethod" = "GitRevisionGraph";
"ReleaseNotesMethod" = "Milestones";
}

write-verbose "POSTing the following JSON to $baseUrl/api/releases/create"
Expand Down
6 changes: 6 additions & 0 deletions .octopus/deployment_settings.ocl
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
deployment_changes_template = <<-EOT
#{each release in Octopus.Deployment.Changes}
#{release.ReleaseNotes}
#{/each}
EOT

connectivity_policy {
}

Expand Down
2 changes: 1 addition & 1 deletion .octopus/schema_version.ocl
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = 4
version = 5

0 comments on commit 8fe03ba

Please sign in to comment.