Skip to content

Commit

Permalink
ci: use gh api to extract tag annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
mttbernardini committed May 7, 2024
1 parent 748beef commit efed551
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
pull_request:
branches: [ "main" ]

defaults:
run:
shell: bash

jobs:
build:
runs-on: ${{ matrix.os }}
Expand All @@ -31,11 +35,9 @@ jobs:
submodules: recursive

- name: Configure CMake
shell: bash
run: cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -B build

- name: Build
shell: bash
run: cmake --build build --config $BUILD_TYPE

- name: Upload
Expand All @@ -53,8 +55,8 @@ jobs:
contents: write

steps:
- name: Checkout to fetch tag annotation
uses: actions/checkout@v4
- name: Install jq for JSON parsing
run: sudo apt-get install -y jq

- name: Download binaries
uses: actions/download-artifact@v4
Expand All @@ -67,7 +69,9 @@ jobs:
run: ls -lR dist/

- name: Extract release notes
run: git cat-file tag ${{ github.ref }} | tail -n +3 > changelog.md
run: |
tag_url=$(curl https://api.github.com/repos/${{ github.repository }}/git/${{ github.ref }} | jq -r '.object.url')
curl $tag_url | jq -r '.message' | tail -n +3 | tee changelog.md
- name: Attach binaries to release
uses: softprops/action-gh-release@v2
Expand Down

0 comments on commit efed551

Please sign in to comment.