Skip to content

Commit

Permalink
migrate to github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Infactum authored Jul 25, 2020
1 parent 4dca437 commit 6e08102
Show file tree
Hide file tree
Showing 7 changed files with 103 additions and 192 deletions.
84 changes: 84 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: CI

on: [push, pull_request]

jobs:
build:
name: Native Build
runs-on: ubuntu-latest
strategy:
matrix:
tag: [bionic, centos7]
container: infactum/tg2sip-builder:${{ matrix.tag }}

steps:
- uses: actions/checkout@v2

- name: Build
run: |
[ -d "/opt/rh" ] && source /opt/rh/devtoolset-7/enable
mkdir build && cd build
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build . -j $(grep -c ^processor /proc/cpuinfo);
- uses: actions/upload-artifact@v2
with:
name: tg2sip_${{ matrix.tag }}
path: |
build/tg2sip
build/gen_db
build/settings.ini
# AppImage generation cannot be fully done inside container
# because of FUSE requirements
- name: Prepare AppImage
if: matrix.tag == 'centos7'
run: |
linuxdeploy --appdir tg2sip -e build/tg2sip
linuxdeploy --appdir gen_db -e build/gen_db
- uses: actions/upload-artifact@v2
if: matrix.tag == 'centos7'
with:
name: tmp
path: |
tg2sip/
gen_db/
appimage:
name: Pack AppImage
needs: [build]
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- uses: actions/download-artifact@v2
with:
name: tmp
path: tmp

- name: Prepare
run: |
wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage -O appimagetool.AppImage
chmod +x appimagetool.AppImage
wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage -O linuxdeploy.AppImage
chmod +x linuxdeploy.AppImage
- name: Pack
run: |
./linuxdeploy.AppImage --appdir tmp/tg2sip -d buildenv/tg2sip.desktop -i buildenv/icon.svg
./linuxdeploy.AppImage --appdir tmp/gen_db -d buildenv/gen_db.desktop -i buildenv/icon.svg
chmod +x tmp/tg2sip/usr/bin/tg2sip
chmod +x tmp/gen_db/usr/bin/gen_db
./appimagetool.AppImage tmp/tg2sip
./appimagetool.AppImage tmp/gen_db
- uses: actions/upload-artifact@v2
with:
name: tg2sip_universal
path: |
tg2sip-x86_64.AppImage
gen_db-x86_64.AppImage
settings.ini;
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Build status](https://ci.appveyor.com/api/projects/status/4dnph34apvfy6vft?svg=true)](https://ci.appveyor.com/project/Infactum/tg2sip)
[![Build status](https://github.com/Infactum/tg2sip/workflows/CI/badge.svg)](https://github.com/Infactum/tg2sip/actions)

# TG2SIP

Expand All @@ -14,10 +14,8 @@ Your SIP PBX should be comaptible with `L16@48000` or `OPUS@48000` voice codec.
* Build them from source.
Requires C++17 supported comiler, which may be a trouble for old linux distros.
* Download prebuild native binaries for one of supported distros.
[Ubuntu 18.04 Bionic](https://ci.appveyor.com/api/projects/Infactum/tg2sip/artifacts/tg2sip_bionic.zip?branch=master&job=Environment%3A%20target_name%3DUbuntu%20Bionic%2C%20docker_tag%3Dbionic)
[CentOS 7](https://ci.appveyor.com/api/projects/Infactum/tg2sip/artifacts/tg2sip_centos7.zip?branch=master&job=Environment%3A%20target_name%3DCentOS%207%2C%20docker_tag%3Dcentos7)
Prebuild binaries requires OPUS libraries (`libopus0` for Ubuntu, `opus` for CentOS, etc).
* [Download](https://ci.appveyor.com/api/projects/Infactum/tg2sip/artifacts/tg2sip.zip?branch=master&job=Environment%3A%20target_name%3DAppImage%2C%20docker_tag%3Dcentos6) universal AppImage package.
* Download universal AppImage package.
More information of what is AppImage can be found here https://appimage.org/

2. Obtain `api_id` and `api_hash` tokens from [this](https://my.telegram.org) page and put them in `settings.ini` file.
Expand Down
75 changes: 0 additions & 75 deletions appveyor.yml

This file was deleted.

94 changes: 0 additions & 94 deletions buildenv/Dockerfile.centos6

This file was deleted.

17 changes: 16 additions & 1 deletion buildenv/Dockerfile.centos7
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ RUN yum install -y \
make \
git wget \
zlib-devel opus-devel openssl-devel gperf \
pkgconfig ccache gperf unzip
pkgconfig ccache gperf unzip \
libpng-devel libjpeg-devel \
epel-release \
&& yum install -y patchelf

RUN wget https://cmake.org/files/v3.18/cmake-3.18.0-Linux-x86_64.sh \
&& sh cmake-3.18.0-Linux-x86_64.sh --prefix=/usr --exclude-subdir
Expand Down Expand Up @@ -53,6 +56,18 @@ RUN source /opt/rh/devtoolset-7/enable \
&& cd / \
&& rm -rf spdlog

RUN source /opt/rh/devtoolset-7/enable \
&& git clone --recursive https://github.com/linuxdeploy/linuxdeploy.git \
&& cd linuxdeploy \
&& git checkout 557bad2241df2c33972c7e6bdbf0c528cee27cc8 \
&& mkdir build \
&& cd build \
&& export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig && cmake -DCMAKE_BUILD_TYPE=Release -DUSE_SYSTEM_CIMG=0 .. \
&& cmake --build . -j $(grep -c ^processor /proc/cpuinfo) \
&& cp bin/linuxdeploy /usr/local/bin \
&& cd / \
&& rm -rf linuxdeploy

COPY centos_entrypoint.sh /

ENTRYPOINT ["/centos_entrypoint.sh"]
17 changes: 0 additions & 17 deletions buildenv/glibc_gcc.patch

This file was deleted.

2 changes: 1 addition & 1 deletion buildenv/prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -e

DOCKER_IMAGE=infactum/tg2sip-builder

for DOCKER_TAG in bionic centos6 centos7
for DOCKER_TAG in bionic centos7
do
docker build . -f Dockerfile."$DOCKER_TAG" -t "$DOCKER_IMAGE:$DOCKER_TAG"
docker push "$DOCKER_IMAGE:$DOCKER_TAG"
Expand Down

0 comments on commit 6e08102

Please sign in to comment.