From f4ebd4fd5e7475141323d8caa08fe04a63e9d5cf Mon Sep 17 00:00:00 2001 From: irkode Date: Tue, 20 Aug 2024 22:49:43 +0200 Subject: [PATCH] add release notes --- .github/workflows/build.yml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 17e2bbc..d08b9ff 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,6 +31,7 @@ jobs: git config --local user.name ${{ secrets.GH_USER_NAME }} git config --global user.email ${{ secrets.GH_USER_MAIL }} git fetch --tags + - name: Prepare repository run: | # cleanup rubbish from the past @@ -57,7 +58,7 @@ jobs: } } } | Sort-Object -Property release - Write-Output "All BULMA Releases" + Write-Output "All new BULMA Releases" $BulmaReleases | FT | Out-Host $BulmaRelease = $BulmaReleases | Where-Object { -Not $_.known } | Select-Object -First 1 if ($BulmaRelease) { @@ -77,11 +78,16 @@ jobs: Get-ChildItem .\assets | Out-Host Write-Error "Aborting - please check" } - Remove-Item $BulmaRelease.archive -ErrorAction SilentlyContinue - [void](Test-Path $BulmaRelease.archive -ErrorAction Stop) echo "BULMA_RELEASE=$($BulmaRelease.release)" | Out-File $Env:GITHUB_ENV -Append -Encoding utf8 echo "BULMA_ARCHIVE=$($BulmaRelease.archive)" | Out-File $Env:GITHUB_ENV -Append -Encoding utf8 Write-Output "download successful: $($BulmaRelease.archive)" + $notes = @("### This release contains the following style files:`n", "- CSS`n") + $notes += Get-ChildItem -Path .\assets\bulma -filter "*.css" -recurse | Resolve-Path -Relative | %{ " - $_" } + $notes += "`n - SASS`n " + $notes += Get-ChildItem -Path .\assets\bulma -filter "*.sass" | Resolve-Path -Relative | %{ " - $_" } + $notes += "`nRelease details on the [official release page](https://github.com/jgthms/bulma/releases/tag/$($BulmaRelease.release))" + $notes | Set-Content -encoding utf8 notes.md + Get-Content notes.md } else { Write-Output "No new Bulma Version found to pack" } @@ -91,8 +97,6 @@ jobs: Write-Host "Creating Release for $ENV:BULMA_RELEASE : $ENV:BULMA_ARCHIVE" $BulmaRelease = "$ENV:BULMA_RELEASE" $BulmaArchive = "$ENV:BULMA_ARCHIVE" - $cwd = ($pwd.Path -replace "\\","\\") + "\\" - (Get-ChildItem .).FullName -replace $cwd, ""|sort $bulmaBranch = "bulma-$BulmaRelease" git checkout -b $bulmaBranch git add assets .github @@ -101,7 +105,6 @@ jobs: # git tag -a "v$BulmaRelease" -m "packed Bulma release $BulmaRelease" # git push --tags git checkout main - gh auth login - gh release create "v$BulmaRelease" --title "Bulma4Hugo v$BulmaRelease" --target $bulmaBranch --latest + gh release create "v$BulmaRelease" --title "Bulma4Hugo v$BulmaRelease" --target $bulmaBranch --latest --notes-file notes.md git branch -D $bulmaBranch git push origin --delete $bulmaBranch