From fb90b1902584e0a1e10f4b32cbc4bcdca986330e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pietrus?= Date: Fri, 19 Jul 2024 13:11:22 +0200 Subject: [PATCH] chore: Update build.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: MichaƂ Pietrus --- .github/workflows/build.yml | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8f60ba9..e4df777 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -48,27 +48,22 @@ jobs: push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} + - name: extract-changelog + id: extract-changelog + uses: sean0x42/markdown-extract@v2 + with: + file: CHANGELOG.md + pattern: ${{ github.ref_name }} + outputs: img-tag: ${{ steps.meta.outputs.img-tag }} + changelog: ${{ steps.extract-changelog.outputs.markdown }} release: runs-on: ubuntu-latest needs: - build steps: - - name: Extract release notes from CHANGELOG.md - id: extract_changelog - run: | - # Get the current tag (e.g., v0.5.0) - TAG=${GITHUB_REF/refs\/tags\//} - # Extract the relevant section from the CHANGELOG.md - awk "/## \[$TAG\]/,/^## \[/{if (\$0 ~ /^## \[/ && \$0 !~ \$TAG) exit; print}" CHANGELOG.md > release_notes.md - # Remove the first line (which is the heading of the section) - sed -i '1d' release_notes.md - # Read the content of the release_notes.md file - RELEASE_NOTES=$(cat release_notes.md) - echo "::set-output name=release_notes::$RELEASE_NOTES" - - name: Release uses: ncipollo/release-action@v1 with: @@ -78,7 +73,7 @@ jobs: - OCA-repository: [ ${{ needs.build.outputs.img-tag }} ](https://${{needs.build.outputs.img-tag}}) ### Changelog - ${{ steps.extract_changelog.outputs.release_notes }} + ${{ needs.build.changelog.outputs.markdown }} removeArtifacts: true makeLatest: true artifacts: ""