From 49adbf6d08f647d09c7a766428bd461dcd4bf20d Mon Sep 17 00:00:00 2001 From: Federico Di Pierro Date: Fri, 15 Sep 2023 17:05:25 +0200 Subject: [PATCH] new(ci): autogenerate release body. Signed-off-by: Federico Di Pierro --- .github/release_template.md | 21 +++++++++++++++++ .github/workflows/release.yaml | 35 +++++++++++++++++++++++++++++ RELEASE.md | 41 +++++----------------------------- 3 files changed, 61 insertions(+), 36 deletions(-) create mode 100644 .github/release_template.md diff --git a/.github/release_template.md b/.github/release_template.md new file mode 100644 index 00000000..ab85e4de --- /dev/null +++ b/.github/release_template.md @@ -0,0 +1,21 @@ +![LIBS](https://img.shields.io/badge/LIBS-LIBSVER-yellow) +![DRIVER](https://img.shields.io/badge/DRIVER-DRIVERVER-yellow) + +| Packages | Download | +| -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | +| rpm-x86_64 | [![rpm](https://img.shields.io/badge/Falco-FALCOVER-%2300aec7?style=flat-square)](https://download.falco.org/packages/rpmFALCOBUCKET/falco-FALCOVER-x86_64.rpm) | +| deb-x86_64 | [![deb](https://img.shields.io/badge/Falco-FALCOVER-%2300aec7?style=flat-square)](https://download.falco.org/packages/debFALCOBUCKET/stable/falco-FALCOVER-x86_64.deb) | +| tgz-x86_64 | [![tgz](https://img.shields.io/badge/Falco-FALCOVER-%2300aec7?style=flat-square)](https://download.falco.org/packages/binFALCOBUCKET/x86_64/falco-FALCOVER-x86_64.tar.gz) | +| rpm-aarch64 | [![rpm](https://img.shields.io/badge/Falco-FALCOVER-%2300aec7?style=flat-square)](https://download.falco.org/packages/rpmFALCOBUCKET/falco-FALCOVER-aarch64.rpm) | +| deb-aarch64 | [![deb](https://img.shields.io/badge/Falco-FALCOVER-%2300aec7?style=flat-square)](https://download.falco.org/packages/debFALCOBUCKET/stable/falco-FALCOVER-aarch64.deb) | +| tgz-aarch64 | [![tgz](https://img.shields.io/badge/Falco-FALCOVER-%2300aec7?style=flat-square)](https://download.falco.org/packages/binFALCOBUCKET/aarch64/falco-FALCOVER-aarch64.tar.gz) | + +| Images | +| --------------------------------------------------------------------------- | +| `docker pull docker.io/falcosecurity/falco:FALCOVER` | +| `docker pull public.ecr.aws/falcosecurity/falco:FALCOVER` | +| `docker pull docker.io/falcosecurity/falco-driver-loader:FALCOVER` | +| `docker pull docker.io/falcosecurity/falco-driver-loader-legacy:FALCOVER` | +| `docker pull docker.io/falcosecurity/falco-no-driver:FALCOVER` | +| `docker pull docker.io/falcosecurity/falco-distroless:FALCOVER` | + diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index f427b6ce..7a4b3e5f 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -122,3 +122,38 @@ jobs: is_latest: ${{ needs.release-settings.outputs.is_latest == 'true' }} tag: ${{ github.event.release.tag_name }} sign: true + + release-body: + needs: [release-settings, publish-docker] + runs-on: ubuntu-latest + steps: + - name: Clone repo + uses: actions/checkout@v4 + + - name: Extract LIBS and DRIVER versions + run: | + cp .github/release_template.md release-body.md + LIBS_VERS=$(cat cmake/modules/falcosecurity-libs.cmake | grep 'set(FALCOSECURITY_LIBS_VERSION' | tail -n1 | grep -o '[[:digit:]]*\.[[:digit:]]*\.[[:digit:]]*') + DRIVER_VERS=$(cat cmake/modules/driver.cmake | grep 'set(DRIVER_VERSION' | tail -n1 | grep -o '[[:digit:]]*\.[[:digit:]]*\.[[:digit:]]*') + sed -i s/LIBSVER/$LIBS_VERS/g release-body.md + sed -i s/DRIVERVER/$DRIVER_VERS/g release-body.md + + - name: Append release matrixes + run: | + sed -i s/FALCOBUCKET/${{ needs.release-settings.outputs.bucket_suffix }}/g release-body.md + sed -i s/FALCOVER/${{ github.event.release.tag_name }}/g release-body.md + + - name: Generate release notes + uses: leodido/rn2md@master + with: + milestone: ${{ github.event.release.tag_name }} + output: ./notes.md + + - name: Merge release notes to pre existent body + run: cat notes.md >> release-body.md + + - name: Release + uses: softprops/action-gh-release@v1 + with: + body_path: ./release-body.md + tag_name: ${{ github.event.release.tag_name }} diff --git a/RELEASE.md b/RELEASE.md index 95d9eaf7..e5c262c5 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -146,48 +146,17 @@ Assume `M.m.p` is the new version. - [Draft a new release](https://github.com/falcosecurity/falco/releases/new) - Use `M.m.p` both as tag version and release title -- Use the following template to fill the release description: +- Do NOT fill body, since it will be generated by the [github release workflow](.github/workflows/release.yaml) +- Publish the release! +- The release pipeline will start automatically upon publication and all packages and container images will be uploaded to the stable repositories. +- Once the release is out the release body will be generated +- Add the release manager handle at the end of the pre-generated release body: ``` - - - | Packages | Download | - | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | - | rpm-x86_64 | [![rpm](https://img.shields.io/badge/Falco-M.m.p-%2300aec7?style=flat-square)](https://download.falco.org/packages/rpm/falco-M.m.p-x86_64.rpm) | - | deb-x86_64 | [![deb](https://img.shields.io/badge/Falco-M.m.p-%2300aec7?style=flat-square)](https://download.falco.org/packages/deb/stable/falco-M.m.p-x86_64.deb) | - | tgz-x86_64 | [![tgz](https://img.shields.io/badge/Falco-M.m.p-%2300aec7?style=flat-square)](https://download.falco.org/packages/bin/x86_64/falco-M.m.p-x86_64.tar.gz) | - | rpm-aarch64 | [![rpm](https://img.shields.io/badge/Falco-M.m.p-%2300aec7?style=flat-square)](https://download.falco.org/packages/rpm/falco-M.m.p-aarch64.rpm) | - | deb-aarch64 | [![deb](https://img.shields.io/badge/Falco-M.m.p-%2300aec7?style=flat-square)](https://download.falco.org/packages/deb/stable/falco-M.m.p-aarch64.deb) | - | tgz-aarch64 | [![tgz](https://img.shields.io/badge/Falco-M.m.p-%2300aec7?style=flat-square)](https://download.falco.org/packages/bin/aarch64/falco-M.m.p-aarch64.tar.gz) | - - | Images | - | --------------------------------------------------------------------------- | - | `docker pull docker.io/falcosecurity/falco:M.m.p` | - | `docker pull public.ecr.aws/falcosecurity/falco:M.m.p` | - | `docker pull docker.io/falcosecurity/falco-driver-loader:M.m.p` | - | `docker pull docker.io/falcosecurity/falco-no-driver:M.m.p` | - - - - - - ### Statistics - - | Merged PRs | Number | - | --------------- | ------ | - | Not user-facing | x | - | Release note | x | - | Total | x | - - - #### Release Manager ``` -- Finally, publish the release! -- The release pipeline will start automatically upon publication and all packages and container images will be uploaded to the stable repositories. - In order to check the status of the release pipeline click on the [GitHub Actions tab](https://github.com/falcosecurity/falco/actions?query=event%3Arelease) in the Falco repository and filter by release. ### 2. Update the meeting notes