Skip to content

Commit

Permalink
v0.12.2 use softprops/action-gh-release@v2 to create binary releases
Browse files Browse the repository at this point in the history
  • Loading branch information
nixargh committed Sep 10, 2024
1 parent dacd7a5 commit e01ef7b
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 7 deletions.
17 changes: 10 additions & 7 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,17 @@ jobs:
chmod -R 0777 ./bin
make build-all
- name: Upload binaries
uses: xresloader/[email protected]
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/') }}
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
40 changes: 40 additions & 0 deletions scripts/read_changelog.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit e01ef7b

Please sign in to comment.