diff --git a/.github/workflows/post-releasenotes.yml b/.github/workflows/post-releasenotes.yml index 6df55f8dd..268d97cc6 100644 --- a/.github/workflows/post-releasenotes.yml +++ b/.github/workflows/post-releasenotes.yml @@ -25,7 +25,7 @@ jobs: version=$(cat release-version) echo "version=$version" >> $GITHUB_OUTPUT - # ironically, we have to upload a file, otherwise this won't create a release with just the release notes + # add a file containing the release title so it can be picked up and listed on the release page on our web server - name: publish release if: github.event_name == 'push' uses: softprops/action-gh-release@v1 @@ -34,5 +34,5 @@ jobs: repository: ${{ github.repository_owner }}/nightly-builds token: ${{ secrets.NIGHTLY_BUILDS }} prerelease: false - files: gh_release_notes.md + files: release_content_title.txt body_path: gh_release_notes.md diff --git a/.gitignore b/.gitignore index ce8a5bed8..3074508a9 100644 --- a/.gitignore +++ b/.gitignore @@ -48,3 +48,4 @@ packaging/ios/asset_catalog_compiler.Info.plist appdata/subsurface.appdata.xml android-mobile/Roboto-Regular.ttf gh_release_notes.md +release_content_title.txt diff --git a/scripts/create-releasenotes.sh b/scripts/create-releasenotes.sh index 1a81b29fe..a024ac54f 100755 --- a/scripts/create-releasenotes.sh +++ b/scripts/create-releasenotes.sh @@ -8,19 +8,23 @@ json=$(gh pr list -s merged -S "$1" --json title,number,url) cp gh_release_notes_top.md gh_release_notes.md if [[ $json != "[]" ]]; then -( - echo -n 'This build was created by [merging pull request ' - echo -n $json | jq -j '.[0]|{number}|join(" ")' - echo -n ' (' - echo -n $json | jq -j '.[0]|{title}|join(" ")' - echo -n ')](' - echo -n $json | jq -j '.[0]|{url}|join(" ")' - echo ' )' -) >> gh_release_notes.md + echo -n $json | jq -j '.[0]|{title}|join(" ")' > release_content_title.txt + + ( + echo -n 'This build was created by [merging pull request ' + echo -n $json | jq -j '.[0]|{number}|join(" ")' + echo -n ' (' + cat release_content_title.txt + echo -n ')](' + echo -n $json | jq -j '.[0]|{url}|join(" ")' + echo ' )' + ) >> gh_release_notes.md else -( - echo "This build was created by directly pushing to the Subsurface repo." - echo "The latest commit was [$(git log --pretty=format:"%an: '%s'" -n1)](https://github.com/subsurface/subsurface/commit/$1 )" -) >> gh_release_notes.md + git log --pretty=format:"%an: '%s'" -n1 > release_content_title.txt + + ( + echo "This build was created by directly pushing to the Subsurface repo." + echo "The latest commit was [$(cat release_content_title.txt)](https://github.com/subsurface/subsurface/commit/$1 )" + ) >> gh_release_notes.md fi cat gh_release_notes_bottom.md >> gh_release_notes.md