diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 43f68644..1da43a92 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -98,14 +98,17 @@ jobs: chmod -R 0777 ./bin make build-all - - name: Upload binaries - uses: xresloader/upload-to-github-release@v1.6.0 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Generate Changelog + run: "./scripts/read_changelog.sh ${{ steps.extract_tag.outputs.tag }} >> ${{ github.workspace }}-CHANGELOG.txt" + + - name: Release + uses: softprops/action-gh-release@v2 + if: startsWith(github.ref, 'refs/tags/') with: - file: "bin/*" - tags: true - draft: true + files: "bin/*" + body_path: "${{ github.workspace }}-CHANGELOG.txt" + make_latest: true + fail_on_unmatched_files: true rolling-release-images: if: ${{ ! startsWith(github.ref, 'refs/tags/') }} diff --git a/CHANGELOG.md b/CHANGELOG.md index eaf61fdf..f841a299 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [0.12.2] - 2024-09-10 +### Added +- `./scripts/read_changelog.sh` a script to get tag's changes from CHANGELOG. + +### Changed +- `CI` **tagged-release-binaries** job makes `softprops/action-gh-release@v2` action. + ## [0.12.1] - 2024-09-10 ### Fixed - `CI` do not run **rolling-release-images** job on tags. diff --git a/scripts/read_changelog.sh b/scripts/read_changelog.sh new file mode 100755 index 00000000..5ba94920 --- /dev/null +++ b/scripts/read_changelog.sh @@ -0,0 +1,40 @@ +#!/bin/sh + +set -u -e + +CHANGELOG=CHANGELOG.md +FOUND=0 + +TAG=$1 + +stringContain() { + case $1 in + $2*) + return 0 + ;; + *) + return 1 + ;; + esac +} + +while IFS= read -r LINE; do + case "$FOUND" in + 0) + if stringContain "${LINE}" "## [${TAG}"; then + echo "${LINE}" + FOUND=$((FOUND + 1)) + fi + ;; + 1) + if stringContain "${LINE}" "## ["; then + FOUND=$((FOUND + 1)) + else + echo "${LINE}" + fi + ;; + 2) + break + ;; + esac +done <$CHANGELOG