Skip to content

Commit 21ff8db

Browse files
committed
Add job to package and upload a release when release tag is created.
1 parent faa198b commit 21ff8db

File tree

3 files changed

+50
-3
lines changed

3 files changed

+50
-3
lines changed

.github/workflows/rtpproxy_ci.yml

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ on:
1414

1515
# added using https://github.com/step-security/secure-repo
1616
permissions:
17-
contents: read
17+
contents: write
1818

1919
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
2020
jobs:
@@ -580,3 +580,41 @@ jobs:
580580
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
581581
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
582582
run: sh -x docker/update_description.sh docker/README.md
583+
584+
release:
585+
name: Create Release
586+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
587+
needs: [LoadJobs_conf, Fuzzing]
588+
runs-on: ubuntu-latest
589+
steps:
590+
- name: Checkout repository
591+
uses: actions/checkout@v4
592+
with:
593+
submodules: 'recursive'
594+
595+
- name: Set Environment
596+
id: job_config
597+
run: |
598+
RELEASE_VER="${GITHUB_REF#refs/tags/v}"
599+
echo "ver=${RELEASE_VER}" >> ${GITHUB_OUTPUT}
600+
echo "src=rtpproxy-${RELEASE_VER}.tar.gz" >> ${GITHUB_OUTPUT}
601+
602+
- name: Create source distribution
603+
run: |
604+
set -x
605+
git rev-parse HEAD > revision.txt
606+
NAME="rtpproxy-${{steps.job_config.outputs.ver}}"
607+
tar --exclude-vcs --exclude=./tests -czvf /tmp/${{steps.job_config.outputs.src}} \
608+
--transform="s|^[.]|${NAME}|" .
609+
mv /tmp/${{steps.job_config.outputs.src}} ${{steps.job_config.outputs.src}}
610+
611+
- name: Create Release
612+
id: create_release
613+
uses: softprops/action-gh-release@v2
614+
env:
615+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
616+
with:
617+
files: ./${{steps.job_config.outputs.src}}
618+
draft: true
619+
prerelease: false
620+
generate_release_notes: true

Makefile.am

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,13 @@ SUB_LIBRE= libre
2222
endif
2323

2424
SUBDIRS= libexecinfo libucl libxxHash $(SUB_LIBRE) makeann $(SUBD_MOD) \
25-
$(SUBD_ELP) src $(SUBD_UDCNT) tests \
25+
$(SUBD_ELP) src $(SUBD_UDCNT) \
2626
$(SUBD_EAUD) ${SUBD_DOCS}
2727

28+
if TESTS_EXIST
29+
SUBDIRS += tests
30+
endif
31+
2832
dist_man_MANS= rtpproxy.8
2933
EXTRA_DIST= README.remote doc rpm/rtpproxy.init rpm/rtpproxy.spec \
3034
LICENSE README.md

configure.ac

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,20 +467,25 @@ AM_CONDITIONAL(ENABLE_LTO, [test "x${ENABLE_LTO}" = "xyes" ])
467467
AM_CONDITIONAL(ENABLE_LIBRTPPROXY, [test "x${ENABLE_LIBRTPPROXY}" = "xyes" ])
468468
AM_CONDITIONAL(ENABLE_LIBUNWIND, [test "${ENABLE_LIBUNWIND}" = 1 ])
469469
AM_CONDITIONAL(ENABLE_noinst, [test "x${ENABLE_noinst}" = "xyes" ])
470+
AM_CONDITIONAL([TESTS_EXIST], [test -d "$srcdir/tests"])
470471

471472
if test "${ENABLE_SILENT}" = "yes"
472473
then
473474
AM_SILENT_RULES([yes])
474475
fi
475476

476-
AC_CONFIG_FILES([Makefile src/Makefile makeann/Makefile tests/Makefile
477+
AC_CONFIG_FILES([Makefile src/Makefile makeann/Makefile
477478
extractaudio/Makefile libexecinfo/Makefile modules/Makefile
478479
modules/acct_csv/Makefile modules/acct_rtcp_hep/Makefile
479480
modules/catch_dtmf/Makefile modules/badmod/Makefile libxxHash/Makefile
480481
libre/Makefile modules/dtls_gw/Makefile modules/ice_lite/Makefile
481482
pertools/Makefile pertools/udp_contention/Makefile libucl/Makefile
482483
python/sippy_lite/sippy/Time/clock_dtime.py doc/Makefile])
483484

485+
AM_COND_IF([TESTS_EXIST], [
486+
AC_CONFIG_FILES([tests/Makefile])
487+
])
488+
484489
AM_COND_IF([BUILD_ELPERIODIC], [
485490
ac_configure_args="$ac_configure_args \"CFLAGS=$CFLAGS\""
486491
AC_CONFIG_SUBDIRS([libelperiodic])

0 commit comments

Comments
 (0)