Skip to content

Commit

Permalink
chore: Update build.yml
Browse files Browse the repository at this point in the history
Signed-off-by: Michał Pietrus <[email protected]>
  • Loading branch information
blelump authored Jul 19, 2024
1 parent ca74e37 commit fb90b19
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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: ""

0 comments on commit fb90b19

Please sign in to comment.