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 Github Action for release #751

Merged
merged 1 commit into from
Sep 15, 2024
Merged
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
33 changes: 33 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Release

on:
push:
tags:
- '*'

jobs:
build:
runs-on: ubuntu-24.04
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: build-static
run: docker build -f docker/Dockerfile --output=. --target=bin .
- name: Set version
run: |
TAG=${{ github.ref_name }}
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
- name: pack
run: |
git ls-files -z | grep -zv '^\.\|gtest\|gmock\|version.h' | \
tar --transform "s:^version.h:include/version.h:" \
--transform "s:^:sipp-$VERSION/:" \
--sort=name --mtime="@$(git log -1 --format=%ct)" \
--owner=0 --group=0 --null --files-from=- \
--numeric-owner -zcf sipp-$VERSION.tar.gz \
sipp.1 version.h
- uses: ncipollo/release-action@v1
with:
generateReleaseNotes: true
artifacts: "sipp-*.tar.gz,sipp"
16 changes: 7 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,13 @@ list](https://lists.sourceforge.net/lists/listinfo/sipp-users).
```
* Then:
```
mkdir sipp-$VERSION
git ls-files -z | tar -c --null \
--exclude=gmock --exclude=gtest --files-from=- | tar -xC sipp-$VERSION
cp sipp.1 sipp-$VERSION/
# check version, and do
cp ${PROJECT_BINARY_DIR:-.}/version.h sipp-$VERSION/include/
tar --sort=name --mtime="@$(git log -1 --format=%ct)" \
--owner=0 --group=0 --numeric-owner \
-czf sipp-$VERSION.tar.gz sipp-$VERSION
git ls-files -z | grep -zv '^\.\|gtest\|gmock\|version.h' | \
tar --transform "s:^version.h:include/version.h:" \
--transform "s:^:sipp-$VERSION/:" \
--sort=name --mtime="@$(git log -1 --format=%ct)" \
--owner=0 --group=0 --null --files-from=- \
--numeric-owner -zcf sipp-$VERSION.tar.gz \
sipp.1 version.h
```
* Upload to github as "binary". Note that github replaces tilde sign
(for ~rcX) with a period.
Expand Down
5 changes: 4 additions & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ RUN apk add --no-cache \
git \
gsl-dev \
gsl-static \
help2man \
libpcap-dev \
make \
ncurses-dev \
Expand All @@ -38,9 +39,11 @@ RUN --mount=type=bind,target=.git,source=.git \
${DEBUG:+-DDEBUG=1} \
${FULL:+-DUSE_SSL=1 -DUSE_SCTP=1} \
&& ninja
RUN help2man --output=sipp.1 -v -v --no-info \
--name='SIP testing tool and traffic generator' ./sipp

FROM scratch AS bin
COPY --from=build /sipp/sipp /sipp
COPY --from=build /sipp/sipp /sipp/sipp.1 /sipp/version.h /

FROM alpine:3.20
CMD ["sipp"]
Expand Down