Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CI for CHANGES.md #3037

Open
wants to merge 2 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/bin/dist-github-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ elif [ "${GITHUB_REF:0:10}" != "refs/tags/" ]; then
fi

tag="${GITHUB_REF#refs/*/}"
if [ ! -f obj/release_note.txt ]; then
{
echo "obj/release_note.txt file is missing."
echo "dist:release-note action must be run first."
} > /dev/stderr
exit 1
fi

if command -v apk; then
apk add --no-cache ca-certificates
Expand All @@ -36,7 +43,7 @@ while ! "$(dirname "$0")/github-release.sh" info \
--repo "$github_repo" \
--tag "$tag" \
--name "$tag" \
--description "" || true
--description - < obj/release_note.txt || true
trial=$((trial + 1))
if [[ "$trial" -gt 5 ]]; then break; fi
done
Expand Down
31 changes: 31 additions & 0 deletions .github/bin/dist-release-note.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash
# Extract a release note from the given changelog file.
# Note that this script is intended to be run by GitHub Actions.
set -e

if [ "$1" = "" ]; then
echo "A changelog file path is missing." > /dev/stderr
exit 1
elif [ "$2" = "" ]; then
echo "An output path is missing." > /dev/stderr
exit 1
fi

tag="${GITHUB_REF#refs/*/}"
wget -O /tmp/submark \
https://github.com/dahlia/submark/releases/download/0.2.0/submark-linux-x86_64
chmod +x /tmp/submark
/tmp/submark \
-o "$2" \
-iO \
--h2 "Version $tag" \
"$1"
rm /tmp/submark

if ! grep -E '\S' "$2" > /dev/null; then
echo "There is no section for the version $tag." > /dev/stderr
exit 1
elif grep -i "to be released" "$2"; then
echo 'Release date should be shown on the release note.' > /dev/stderr
exit 1
fi
15 changes: 15 additions & 0 deletions .github/workflows/check-changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: check-changelog
on:
pull_request:
types: [assigned, opened, synchronize, reopened, labeled, unlabeled]
branches:
- main
- development
- 'rc-*'
jobs:
check-changelog:
runs-on: ubuntu-latest
steps:
- uses: tarides/changelog-check-action@v2
with:
changelog: CHANGES.md
5 changes: 5 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ jobs:
with:
dotnet-version: 6.0.x
- run: .github/bin/dist-pack.sh
- run: .github/bin/dist-release-note.sh CHANGES.md obj/release_note.txt
- uses: actions/upload-artifact@main
with:
name: dist-obj
path: obj/
- run: .github/bin/dist-github-release.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25 changes: 25 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Lib9c changelog
===============

Version v200221
---------------

To be released.

### Deprecated APIs

### Backward-incompatible API changes

### Backward-incompatible network protocol changes

### Backward-incompatible storage format changes

### Added APIs

### Behavioral changes

### Bug fixes

### Dependencies

### CLI tools
Loading