Skip to content

Commit

Permalink
Create GitHub workflow: build-deb.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
xiota committed Mar 7, 2023
1 parent 7f2d269 commit acd1f4e
Showing 1 changed file with 95 additions and 0 deletions.
95 changes: 95 additions & 0 deletions .github/workflows/build-deb.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: build-deb

on:
workflow_dispatch:
push:
tags:
- v*

# cancel already running builds of the same branch or pull request
concurrency:
group: ci-${{ github.head_ref }} || concat(${{ github.ref }}
cancel-in-progress: true

env:
CONFIGURE_FLAGS: --disable-silent-rules --prefix=/usr

jobs:
linux:
name: Linux Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Dependencies
run: |
sudo apt-get update --quiet --quiet
# write dependencies to a temporary file which is then fed to "apt-get install",
# so we can use comments in the dependency list
cat << EOF > $RUNNER_TEMP/dependencies
autotools-dev
debhelper
dh-autoreconf
dpkg-dev
geany
libcmark-gfm-dev
libcmark-gfm-extensions-dev
libglib2.0-dev
libgtk-3-dev
libpodofo-dev
libwebkit2gtk-4.0-dev
EOF
grep -v '^[ ]*#' $RUNNER_TEMP/dependencies | xargs sudo apt-get install --assume-yes --no-install-recommends
- name: Configure
run: |
NOCONFIGURE=1 ./autogen.sh
mkdir _build
cd _build
{ ../configure $CONFIGURE_FLAGS || { cat config.log; exit 1; } ; }
- name: Build
run: |
cd _build
make -j ${{ env.JOBS }}
- name: Create packages
run: |
if [ "x$GITHUB_EVENT_NAME" = "xworkflow_dispatch" ] ; then
_version="0.0.0"
else
_version="${GITHUB_REF##*/v}"
fi
cd _build
_pkgdir="$PWD/geany-preview-$_version"
mkdir -p "$_pkgdir/DEBIAN"
make install DESTDIR="$_pkgdir"
_size=$(du "$_pkgdir" --max-depth=0 | xargs -n1 | tail -n +1 | head -n1) \
echo "Package: geany-plugin-preview" > "$_pkgdir/DEBIAN/control"
echo "Version: $_version" >> "$_pkgdir/DEBIAN/control"
cat << EOF >> "$_pkgdir/DEBIAN/control"
Architecture: amd64
Maintainer: none <noreplay@nowhere.com>
EOF
echo "Installed-Size: $_size" >> "$_pkgdir/DEBIAN/control"
cat << EOF >> "$_pkgdir/DEBIAN/control"
Depends: geany, libcmark-gfm0 | libcmark-gfm0.29.0.gfm.3, libcmark-gfm-extensions0 | libcmark-gfm-extensions0.29.0.gfm.3, libpodofo-utils, libwebkit2gtk-4.0-37
Enhances: geany
Section: devel
Priority: optional
Homepage: https://github.com/xiota/geany-preview
Description: Preview plugin for Geany
This plugin provides a preview pane for Geany to view the formatting of
several light-weight languages as they are edited. Supported document
types include AsciiDoc, DocBook, Fountain, HTML, LaTeX, Markdown, MediaWiki,
reStructuredText, Textile, and Txt2Tags.
EOF
dpkg-deb -b "$_pkgdir"
- name: Archive artifacts
uses: actions/upload-artifact@v3
with:
name: geany-preview
path: _build/*.deb

0 comments on commit acd1f4e

Please sign in to comment.