summaryrefslogtreecommitdiffstats
path: root/.github/workflows
diff options
context:
space:
mode:
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/ci.yml238
-rw-r--r--.github/workflows/coverity.yml51
-rwxr-xr-x.github/workflows/debuilder.sh62
-rwxr-xr-x.github/workflows/gen_release.pl40
-rw-r--r--.github/workflows/on_release.yml149
-rw-r--r--.github/workflows/on_tag.yml31
6 files changed, 571 insertions, 0 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 0000000..12033db
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,238 @@
+name: CI
+
+# Should run only on branches and PR, as "on_tag.yml" will handle tags
+on:
+ push:
+ branches: master test
+ pull_request:
+ branches: master
+
+jobs:
+
+#
+# Linux
+#
+ Ubuntu:
+ name: Ubuntu debuild
+ runs-on: ubuntu-20.04
+ steps:
+ - uses: actions/checkout@v2
+ - name: prepare
+ run: |
+ sudo apt-get update
+ sudo apt-get install -y autoconf automake autopoint autotools-dev \
+ gettext libdbus-1-dev pkg-config xmlto \
+ devscripts build-essential lintian \
+ debhelper-compat \
+ dh-exec libdbus-1-dev \
+ libmagick++-dev libv4l-dev python3-dev \
+ libgtk-3-dev lftp \
+ dh-sequence-python3 libgtk2.0-dev \
+ libqt5x11extras5-dev qtbase5-dev
+ - name: build
+ run: |
+ .github/workflows/debuilder.sh
+
+ Ubuntu_Gtk2:
+ name: Ubuntu with Gtk2
+ runs-on: ubuntu-18.04
+ steps:
+ - uses: actions/checkout@v2
+ - name: prepare
+ run: |
+ sudo apt update
+ sudo apt-get install -y autoconf automake autopoint autotools-dev \
+ gettext libdbus-1-dev libgtk2.0-dev libmagick++-dev \
+ libqt5x11extras5-dev libv4l-dev libx11-dev openjdk-8-jdk-headless \
+ perl pkg-config python-all-dev python-all-dbg python-gtk2-dev \
+ qt5-default xmlto
+
+ - name: configure
+ run: |
+ autoreconf -vfi
+ export QT_SELECT=5
+ ./configure
+ - name: build
+ run:
+ make
+ - name: check
+ run:
+ make check-local
+ - name: install
+ run:
+ sudo make install
+ Ubuntu_Gtk3:
+ name: Ubuntu with Gtk3
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - name: prepare
+ run: |
+ sudo apt update
+ sudo apt-get install -y autoconf automake autopoint autotools-dev \
+ gettext libdbus-1-dev gir1.2-gtk-3.0 libgtk-3-dev \
+ libgirepository1.0-dev libmagick++-dev libqt5x11extras5-dev \
+ libv4l-dev libx11-dev openjdk-8-jdk-headless perl \
+ pkg-config python3-minimal python3-dev python3 python3-gi \
+ qt5-default xmlto
+ - name: configure
+ run: |
+ autoreconf -vfi
+
+ # Let configure get this
+ unset PYTHON_CFLAGS PYTHON
+
+ export QT_SELECT=5
+ ./configure --with-gtk=gtk3 --with-python=python3
+ - name: build
+ run:
+ make
+ - name: check
+ run:
+ make check-local
+ - name: install
+ run:
+ sudo make install
+ Mingw_w64_VfW:
+ name: Mingw-w64 VfW
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - name: prepare
+ run: |
+ sudo apt update
+ sudo apt-get install -y autoconf automake autopoint autotools-dev \
+ gettext libdbus-1-dev pkg-config win-iconv-mingw-w64-dev \
+ binutils-mingw-w64-i686 gcc-mingw-w64 mingw-w64-i686-dev \
+ mingw-w64-common xmlto
+ - name: configure
+ run: |
+ export PKG_CONFIG_PATH=/usr/x86_64-w64-mingw32/lib/pkgconfig
+
+ autoreconf -vfi
+
+ CC=i686-w64-mingw32-gcc ./configure \
+ --host=i686-w64-mingw32 --prefix=/usr/local/win32 \
+ --without-gtk --without-python --without-qt --without-java \
+ --without-imagemagick --enable-pthread
+ - name: build
+ run:
+ make
+ - name: install
+ run:
+ sudo make install
+ Mingw_w64_DShow:
+ name: Mingw-w64 DShow
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - name: prepare
+ run: |
+ sudo apt update
+ sudo apt-get install -y autoconf automake autopoint autotools-dev \
+ gettext libdbus-1-dev pkg-config win-iconv-mingw-w64-dev \
+ binutils-mingw-w64-i686 gcc-mingw-w64 mingw-w64-i686-dev \
+ mingw-w64-common xmlto
+ - name: configure
+ run: |
+ export PKG_CONFIG_PATH=/usr/x86_64-w64-mingw32/lib/pkgconfig
+
+ autoreconf -vfi
+
+ CC=i686-w64-mingw32-gcc ./configure \
+ --host=i686-w64-mingw32 --prefix=/usr/local/win32 \
+ --without-gtk --without-python --without-qt --without-java \
+ --without-imagemagick --enable-pthread \
+ --with-directshow
+ - name: build
+ run:
+ make
+ - name: install
+ run:
+ sudo make install
+
+#
+# Mac OS
+#
+ Mac_OS:
+ name: Mac OS
+ runs-on: macos-latest
+ steps:
+ - uses: actions/checkout@v2
+ - name: prepare
+ run: |
+ brew install gettext autoconf automake libiconv libtool \
+ gs graphicsmagick python xmlto pkg-config ccache
+
+ brew unlink libtool && brew link libtool
+ brew unlink gettext && brew link gettext
+ - name: configure
+ run:
+ autoreconf -vfi
+
+ ./configure --disable-video --disable-nls --with-python=python3
+
+ - name: build
+ run: |
+ make
+ sudo make install
+
+#
+# Windows
+#
+ Windows:
+ name: Windows
+ runs-on: windows-latest
+ strategy:
+ matrix:
+ arch: [x86_64, i686]
+ video: [VfW, DShow]
+ include:
+ - arch: x86_64
+ msystem: MINGW64
+ grep: x86-64
+ - arch: i686
+ msystem: MINGW32
+ grep: 386
+ - video: DShow
+ extra: --with-directshow
+ - video: VfW
+ extra:
+ defaults:
+ run:
+ shell: msys2 {0}
+
+ env:
+ CPPFLAGS: -D__USE_MINGW_ANSI_STDIO=1
+
+ steps:
+ - uses: msys2/setup-msys2@v2
+ with:
+ msystem: ${{ matrix.msystem }}
+ update: false
+ install: >-
+ mingw-w64-${{ matrix.arch }}-gcc
+ mingw-w64-${{ matrix.arch }}-iconv
+ mingw-w64-${{ matrix.arch }}-imagemagick
+ mingw-w64-${{ matrix.arch }}-python
+ base-devel git xmlto
+ autoconf libtool automake gettext make autoconf-archive pkg-config
+
+ - uses: actions/checkout@v2
+
+ - name: configure
+ shell: msys2 {0}
+ run: |
+ autoreconf -vfi
+ ./configure LDFLAGS="-static" \
+ --enable-pthread --disable-dependency-tracking \
+ ${{ matrix.extra }}
+
+ - name: build
+ shell: msys2 {0}
+ run:
+ make
+ - name: install
+ shell: msys2 {0}
+ run:
+ make install
diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml
new file mode 100644
index 0000000..e99308d
--- /dev/null
+++ b/.github/workflows/coverity.yml
@@ -0,0 +1,51 @@
+name: Run coverity scan
+on:
+ workflow_dispatch:
+
+ schedule:
+ - cron: '3 8 * * *' # Daily at 08:03 UTC
+
+jobs:
+ Coverity:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - name: Install packages
+ run: |
+ sudo apt-get update
+ sudo apt-get install -y autoconf automake autopoint autotools-dev \
+ gettext libdbus-1-dev gir1.2-gtk-3.0 libgtk-3-dev \
+ libgirepository1.0-dev libmagick++-dev libqt5x11extras5-dev \
+ libv4l-dev libx11-dev openjdk-8-jdk-headless perl \
+ pkg-config python3-minimal python3-dev python3 python3-gi \
+ qt5-default xmlto
+ - name: Download Coverity Build Tool
+ env:
+ TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
+ run: |
+ wget -q https://scan.coverity.com/download/cxx/linux64 \
+ --post-data "token=$TOKEN&project=ZBar" \
+ -O cov-analysis-linux64.tar.gz
+ mkdir cov-analysis-linux64
+ tar xzf cov-analysis-linux64.tar.gz --strip 1 -C cov-analysis-linux64
+ - name: Fixed world writable dirs
+ run: |
+ chmod go-w $HOME
+ sudo chmod -R go-w /usr/share
+ - name: Prepare Coverity
+ run: |
+ autoreconf -vfi
+ ./configure
+ export PATH=${PWD}/cov-analysis-linux64/bin:$PATH
+ cov-build --dir cov-int make
+ - name: Submit the result to Coverity Scan
+ env:
+ TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
+ run: |
+ tar czvf zbar.tgz cov-int
+ curl --form token=$TOKEN \
+ --form email=mchehab@kernel.org \
+ --form file=@zbar.tgz \
+ --form version=trunk \
+ --form description="Zbar-git-$(git log -1 --pretty='%h')" \
+ https://scan.coverity.com/builds?project=ZBar
diff --git a/.github/workflows/debuilder.sh b/.github/workflows/debuilder.sh
new file mode 100755
index 0000000..9c3958a
--- /dev/null
+++ b/.github/workflows/debuilder.sh
@@ -0,0 +1,62 @@
+#!/bin/bash
+set -e
+
+# A debian ruleset file which runs on Github's distro
+DEB_FNAME="zbar_0.23.90-*.debian.tar.xz"
+DEB_URL="http://deb.debian.org/debian/pool/main/z/zbar/"
+
+# Should be the same version as provided by the host OS
+COMPAT=12
+
+# Set directories used during the build
+
+ZBARDIR=${PWD}
+BUILDDIR=${ZBARDIR}/../build
+
+echo "Generating an origin tarball"
+
+cd "${ZBARDIR}"
+
+VER=$(cat "${ZBARDIR}/configure.ac" | grep AC_INIT | perl -ne 'print $1 if /(\d+[.\d]+)/')
+TAR=${ZBARDIR}/../zbar_${VER}.orig.tar.gz
+
+git archive --format tgz -o "${TAR}" HEAD
+
+echo "Retrieving Debian ruleset"
+lftp -e "mget -c ${DEB_FNAME}; exit" "${DEB_URL}"
+
+# Ensure to use just one version, in case multiple ones were downloaded
+DEB_FNAME=$(ls -1 ${DEB_FNAME} | tail -1)
+
+echo "Preparing build environment"
+rm -rf "${BUILDDIR}/" || true
+mkdir -p "${BUILDDIR}"
+cd "${BUILDDIR}"
+
+tar xf "${TAR}"
+tar xf "${ZBARDIR}/${DEB_FNAME}"
+
+# Ensure that debhelper-compat will use the one expected by the build distro
+sed -E "s#debhelper-compat.*,#debhelper-compat (= $COMPAT),#" -i debian/control
+
+# Ignore missing SONAME for libs, if any, as it is not a build robot's task
+# to update ${DEB_FNAME} ruleset
+echo -e "\noverride_dh_shlibdeps:" >> debian/rules
+echo -e "\tdh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info" >> debian/rules
+
+# We want it to build cleanly - so drop all patches from it
+rm -rf debian/patches
+
+# Override the changelog to ensure that it will contain the current version
+cat << EOF > debian/changelog
+zbar (${VER}) unstable; urgency=medium
+
+ * Upstream version
+
+ -- LinuxTV bot <linuxtv-commits@linuxtv.org> $(date -R)
+EOF
+
+OS_VERSION=$(. /etc/os-release && echo "$ID-$VERSION_ID")
+
+echo "Building ZBar packages for ${OS_VERSION}"
+debuild -us -uc
diff --git a/.github/workflows/gen_release.pl b/.github/workflows/gen_release.pl
new file mode 100755
index 0000000..9a108ce
--- /dev/null
+++ b/.github/workflows/gen_release.pl
@@ -0,0 +1,40 @@
+#!/usr/bin/perl
+
+my $body_path = shift or die "Need a file name to store the release body";
+
+my $ver;
+
+open IN, "configure.ac" or die;
+while (<IN>) {
+ if (m/^[^\#]*AC_INIT\s*\(\s*\[\s*zbar\s*\]\s*,\s*\[(\d+[\.\d]+)/) {
+ $ver=$1;
+ last;
+ }
+}
+close IN or die;
+
+die if (!$ver);
+
+sub gen_version() {
+ print "Generating release for version $ver\n";
+
+ open IN, "ChangeLog" or return "error opening ChangeLog";
+ open OUT, ">$body_path" or return "error creating $body_path";
+ my $start=1;
+ while (<IN>) {
+ if ($start) {
+ print OUT $_;
+ $start = 0;
+ next;
+ }
+ last if (m/^\S/);
+ print OUT $_ or return "error writing to $body_path";
+ }
+ close OUT or return "error closing $body_path";
+
+ return "";
+}
+
+my $ret = gen_version();
+
+die($ret) if ($ret ne "");
diff --git a/.github/workflows/on_release.yml b/.github/workflows/on_release.yml
new file mode 100644
index 0000000..218119c
--- /dev/null
+++ b/.github/workflows/on_release.yml
@@ -0,0 +1,149 @@
+name: Upload binaries to release
+
+on:
+ release:
+ types:
+ - created
+ - published
+ - edited
+
+ workflow_dispatch:
+
+jobs:
+ Ubuntu:
+ name: Build for Ubuntu 20.04
+ runs-on: ubuntu-20.04
+ steps:
+ - uses: actions/checkout@v2
+ - name: prepare
+ run: |
+ sudo apt-get update
+ sudo apt-get install -y autoconf automake autopoint autotools-dev \
+ gettext libdbus-1-dev pkg-config xmlto \
+ devscripts build-essential lintian \
+ debhelper-compat \
+ dh-exec libdbus-1-dev \
+ libmagick++-dev libv4l-dev python3-dev \
+ libgtk-3-dev lftp \
+ dh-sequence-python3 libgtk2.0-dev \
+ libqt5x11extras5-dev qtbase5-dev
+ - name: build
+ run: |
+ .github/workflows/debuilder.sh
+ - name: generating tarball
+ run: |
+ (cd ..; tar cvfz zbar-ubuntu-20.04.tar.gz *deb)
+
+ - name: upload
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ uses: mchehab/upload-release-asset@v1.0.3
+ with:
+ upload_url: ${{ github.event.release.upload_url }}
+ asset_path: ../zbar-ubuntu-20.04.tar.gz
+ asset_name: zbar-ubuntu-20.04.tar.gz
+ asset_content_type: application/gzip
+
+ Mac_OS:
+ name: Build for Mac OS
+ runs-on: macos-latest
+ steps:
+ - uses: actions/checkout@v2
+ - name: prepare
+ run: |
+ brew install gettext autoconf automake libiconv libtool \
+ gs graphicsmagick python xmlto pkg-config ccache
+
+ brew unlink libtool && brew link libtool
+ brew unlink gettext && brew link gettext
+ - name: configure
+ run:
+ autoreconf -vfi
+
+ ./configure --disable-video --disable-nls --with-python=python3
+
+ - name: build
+ run: |
+ make
+ DESTDIR=${PWD}/macos make install
+ - name: generating tarball
+ run: |
+ DIR="$PWD"
+ tar c -C ${PWD}/macos -f ${DIR}/zbar-macos.tar.gz -z .
+ - name: upload
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ uses: mchehab/upload-release-asset@v1.0.3
+ with:
+ upload_url: ${{ github.event.release.upload_url }}
+ asset_path: ./zbar-macos.tar.gz
+ asset_name: zbar-macos.tar.gz
+ asset_content_type: application/gzip
+
+ Windows:
+ name: Build for Windows
+ runs-on: windows-latest
+ strategy:
+ matrix:
+ arch: [x86_64, i686]
+ video: [VfW, DShow]
+ include:
+ - arch: x86_64
+ msystem: MINGW64
+ grep: x86-64
+ - arch: i686
+ msystem: MINGW32
+ grep: 386
+ - video: DShow
+ extra: --with-directshow
+ - video: VfW
+ extra:
+ defaults:
+ run:
+ shell: msys2 {0}
+
+ env:
+ CPPFLAGS: -D__USE_MINGW_ANSI_STDIO=1
+
+ steps:
+ - uses: msys2/setup-msys2@v2
+ with:
+ msystem: ${{ matrix.msystem }}
+ update: false
+ install: >-
+ mingw-w64-${{ matrix.arch }}-gcc
+ mingw-w64-${{ matrix.arch }}-iconv
+ mingw-w64-${{ matrix.arch }}-imagemagick
+ mingw-w64-${{ matrix.arch }}-python
+ base-devel git xmlto zip
+ autoconf libtool automake gettext make autoconf-archive pkg-config
+
+ - uses: actions/checkout@v2
+
+ - name: configure
+ shell: msys2 {0}
+ run: |
+ autoreconf -vfi
+ ./configure LDFLAGS="-static" \
+ --enable-pthread --disable-dependency-tracking \
+ ${{ matrix.extra }}
+
+ - name: build
+ shell: msys2 {0}
+ run:
+ make
+ - name: generating zip
+ shell: msys2 {0}
+ run: |
+ DESTDIR=${PWD}/win_${{ matrix.arch }}-${{ matrix.video }} make install
+ (cd ${PWD}/win_${{ matrix.arch }}-${{ matrix.video }}; zip -r ../zbar-win_${{ matrix.arch }}-${{ matrix.video }}.zip .)
+
+ - name: upload
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ uses: mchehab/upload-release-asset@v1.0.3
+ with:
+ upload_url: ${{ github.event.release.upload_url }}
+ asset_path: ./zbar-win_${{ matrix.arch }}-${{ matrix.video }}.zip
+ asset_name: zbar-win_${{ matrix.arch }}-${{ matrix.video }}.zip
+ asset_content_type: application/gzip
diff --git a/.github/workflows/on_tag.yml b/.github/workflows/on_tag.yml
new file mode 100644
index 0000000..b1d48fe
--- /dev/null
+++ b/.github/workflows/on_tag.yml
@@ -0,0 +1,31 @@
+name: Create release on tag
+
+on:
+ workflow_dispatch:
+ push:
+ # Sequence of patterns matched against refs/tags
+ tags:
+ - '[0-9]+*'
+
+jobs:
+ release:
+ name: Create Release
+ runs-on: ubuntu-latest
+ outputs:
+ upload_url: ${{ steps.create_release.outputs.upload_url }}
+ steps:
+ - uses: actions/checkout@v2
+ - name: Release changelog
+ run: .github/workflows/gen_release.pl body_file.tmp
+
+ - name: Create Release
+ id: create_release
+ uses: actions/create-release@v1
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ with:
+ tag_name: ${{ github.ref }}
+ release_name: Release ${{ github.ref }}
+ body_path: body_file.tmp
+ draft: false
+ prerelease: true