From 2c29561f710de036679b07f46c7005017bbe1e8e Mon Sep 17 00:00:00 2001 From: andy5995 Date: Tue, 20 Sep 2022 13:36:51 -0500 Subject: [PATCH] add appimage build --- .github/scripts/all_tests.sh | 55 ++++++++++++++++++++++++----------- .github/workflows/release.yml | 33 +++++++++++++++++++++ 2 files changed, 71 insertions(+), 17 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/scripts/all_tests.sh b/.github/scripts/all_tests.sh index 44f07da4..d2164c3d 100644 --- a/.github/scripts/all_tests.sh +++ b/.github/scripts/all_tests.sh @@ -2,6 +2,8 @@ set -ev +BUILDDIR="$PWD/builddir" + sudo apt-get install -y gettext USE_VALGRIND="" @@ -21,26 +23,45 @@ else sudo -H python3 -m pip install meson ninja fi -meson builddir -cd builddir -ninja -v -ninja dist +meson $BUILDDIR +cd $BUILDDIR -if [ -n "$USE_VALGRIND" ]; then - meson test --setup=valgrind -fi +if [ -z "${MAKE_APPIMAGE}" ]; then + ninja -v + ninja dist -# fake media root -meson test --setup=fake_media_root --suite rmw + if [ -n "$USE_VALGRIND" ]; then + meson test --setup=valgrind + fi -# nls disabled -meson configure -Dnls=false -ninja -v -meson test -v + # fake media root + meson test --setup=fake_media_root --suite rmw -# curses disabled -meson configure -Dwithout-curses=true -if [ -n "$USE_VALGRIND" ]; then + # nls disabled + meson configure -Dnls=false ninja -v - meson test --setup=valgrind + meson test -v + + # curses disabled + meson configure -Dwithout-curses=true + if [ -n "$USE_VALGRIND" ]; then + ninja -v + meson test --setup=valgrind + fi +else + VERSION=${GITHUB_REF_NAME:1} + meson configure -Dbuildtype=release -Dstrip=true -Dprefix=/usr + DESTDIR=AppDir ninja install + cp /usr/bin/rm AppDir/usr/bin + cd - + wget -nv https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-${ARCH}.AppImage + chmod +x linuxdeploy-${ARCH}.AppImage + ./linuxdeploy-${ARCH}.AppImage \ + -d packaging/rmw.desktop \ + --icon-file=packaging/rmw_icon_32x32.png \ + --icon-filename=rmw \ + --executable ${BUILDDIR}/AppDir/usr/bin/rmw \ + --appdir ${BUILDDIR}/AppDir \ + --output appimage + sha256sum rmw-${VERSION}-${ARCH}.AppImage > rmw-${VERSION}-${ARCH}.AppImage.sha256sum fi diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..c2770e22 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,33 @@ +name: Release +concurrency: + group: build-${{ github.ref }} + cancel-in-progress: true + +on: + push: + tags: + - v** + +jobs: + build: + runs-on: ubuntu-20.04 + env: + MAKE_APPIMAGE: true + ARCH: x86_64 + steps: + - uses: actions/checkout@v3 + - name: Prepare AppImage + run: sh ./.github/scripts/all_tests.sh + + - name: Release AppImage + uses: ncipollo/release-action@v1 + with: + allowUpdates: True + artifacts: "rmw*.AppImage*" + token: ${{ secrets.GITHUB_TOKEN }} + omitNameDuringUpdate: True + omitBodyDuringUpdate: True + replacesArtifacts: false + - name: remove artifacts + run: rm rmw*.AppImage* +