[PATCH] ci: add workflow to mark tags as GitHub releases
Kamran Alam
kamranalam4555 at gmail.com
Sun Mar 22 01:51:07 AEDT 2026
>
> Thank you for the review, Gao Xiang.
I have updated the patch addressing all your feedback:
1. Added "erofs-utils:" prefix to subject
2. Extract release notes from ChangeLog file
3. Build static Linux binaries using Alpine/musl
---
.github/workflows/release.yml | 121 +++++++++++++++++++++
1 file changed, 121 insertions(+)
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,121 @@
name: Release
on:
push:
tags:
- "*"
permissions:
contents: write
jobs:
build-static-linux-musl:
name: Build static Linux binaries (musl)
runs-on: ubuntu-latest
container:
image: alpine:3.20
steps:
- name: Checkout source
uses: actions/checkout at v4
- name: Install build dependencies
run: |
apk add --no-cache \
bash \
build-base \
autoconf \
automake \
libtool \
lz4-dev \
zlib-dev \
fuse-dev \
musl-dev \
tar \
gzip
- name: Configure and build
run: |
./autogen.sh
./configure --enable-static
make -j"$(getconf _NPROCESSORS_ONLN || echo 2)"
- name: Create release archive
env:
TAG_NAME: ${{ github.ref_name }}
run: |
set -e
archive="erofs-utils-${TAG_NAME}-linux-musl-static.tar.gz"
mkdir -p dist/bin
for bin in \
mkfs/mkfs.erofs \
fsck/fsck.erofs \
dump/dump.erofs \
fuse/erofsfuse \
mount/mount.erofs; do
if [ -x "$bin" ]; then
install -m 0755 "$bin" dist/bin/
fi
done
tar -C dist -czf "$archive" .
echo "archive=$archive" >> "$GITHUB_OUTPUT"
id: package
- name: Upload build artifact
uses: actions/upload-artifact at v4
with:
name: static-linux-musl
path: ${{ steps.package.outputs.archive }}
release:
name: Publish release
runs-on: ubuntu-latest
needs: build-static-linux-musl
steps:
- name: Checkout source
uses: actions/checkout at v4
- name: Download build artifact
uses: actions/download-artifact at v4
with:
name: static-linux-musl
path: .
- name: Extract release notes from ChangeLog
id: changelog
shell: bash
run: |
tag_version="${GITHUB_REF_NAME#v}"
notes_file="$(mktemp)"
awk -v ver="$tag_version" '
$0 ~ "^erofs-utils " {
if (capture) exit
if ($0 ~ "^erofs-utils " ver "([[:space:]]|$|\\()") {
capture=1
next
}
}
capture && /^ -- / { exit }
capture { print }
' ChangeLog > "$notes_file"
sed -i '/^[[:space:]]*$/N;/^\n$/D' "$notes_file"
if [ ! -s "$notes_file" ]; then
echo "No matching changelog entry found for
${GITHUB_REF_NAME}." > "$notes_file"
fi
{
echo "body<<EOF"
cat "$notes_file"
echo "EOF"
} >> "$GITHUB_OUTPUT"
- name: Create GitHub release
uses: softprops/action-gh-release at v2
with:
name: ${{ github.ref_name }}
body: ${{ steps.changelog.outputs.body }}
files: erofs-utils-${{ github.ref_name }}-linux-musl-static.tar.gz
Signed-off-by: Kamran Alam <kamrankhan0368 at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/linux-erofs/attachments/20260321/f15f42c8/attachment.htm>
More information about the Linux-erofs
mailing list