diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7a83c520588..e2f387b4c7f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -219,29 +219,6 @@ jobs: ls -la dist - name: Install zsh (release body generation dependency) run: sudo apt update && sudo apt install -y zsh - - name: Generate release body - env: - tag: ${{ fromJSON(steps.project.outputs.config).tag }} - previous: ${{ fromJSON(steps.project.outputs.config).previous }} - current: ${{ github.event.inputs.ref || github.sha }} - run: | - echo "# $tag" > release_body.md - echo "" >> release_body.md - csplit --digits=4 --quiet --elide-empty-files CHANGELOG.md '/^# /' '{*}' - # Checking the files in reverse order to get to the UNRELEASED section last - for file in $(ls -r xx*); do - if grep -q "^# $tag " $file || grep -q "^# UNRELEASED" $file; then - tail -n +3 $file >> release_body.md - break - fi - done - if [[ "$previous" != '' ]]; then - mkdir -p "$(go env GOPATH)/src/github.com/filecoin-project/lotus" - rm -rf "$(go env GOPATH)/src/github.com/filecoin-project/lotus" - ln -s "$(pwd)" "$(go env GOPATH)/src/github.com/filecoin-project/lotus" - ./scripts/mkreleaselog "$previous" "$current" >> release_body.md - fi - cat release_body.md - name: Find release id: before env: @@ -250,8 +227,34 @@ jobs: run: | echo "release<> release_body.md + else + csplit --digits=4 --quiet --elide-empty-files CHANGELOG.md '/^# /' '{*}' + # Checking the files in reverse order to get to the UNRELEASED section last + for file in $(ls -r xx*); do + if grep -q "^# $tag " $file || grep -q "^# UNRELEASED" $file; then + tail -n +3 $file >> release_body.md + break + fi + done + if [[ "$previous" != '' ]]; then + mkdir -p "$(go env GOPATH)/src/github.com/filecoin-project/lotus" + rm -rf "$(go env GOPATH)/src/github.com/filecoin-project/lotus" + ln -s "$(pwd)" "$(go env GOPATH)/src/github.com/filecoin-project/lotus" + ./scripts/mkreleaselog "$previous" "$current" >> release_body.md + fi + fi + cat release_body.md - name: Create or update release id: after env: