Lagrange [release]

Add github workflow for debian packaging

bcc61dc6eb62234947dd794a80b3e084a054164a
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
new file mode 100644
index 00000000..b786f39e
--- /dev/null
+++ b/.github/workflows/build.yml
@@ -0,0 +1,70 @@
+name: packages
+
+on:
+  push:
+    tags:
+      - 'v*.*.*'
+  workflow_dispatch:
+
+env:
+  RELEASE_VERSION: 0.6.1
+
+jobs:
+  build:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v2
+        with:
+          fetch-depth: '0'
+          submodules: 'recursive'
+      - name: install-dependencies
+        run: |
+          git submodule sync
+          sudo apt-get update -qq -y
+          sudo apt-get install -y -qq --no-install-recommends cmake libsdl2-dev libssl-dev libpcre3-dev zlib1g-dev libunistring-dev libmpg123-dev debhelper dh-make devscripts fakeroot build-essential
+      - name: package-build
+        run: |
+          git archive --format=tar.gz --prefix=lagrange-${RELEASE_VERSION}/ HEAD >lagrange-${RELEASE_VERSION}.tar.gz
+          tar -xvzf lagrange-${RELEASE_VERSION}.tar.gz
+          ln -s lagrange-${RELEASE_VERSION}.tar.gz lagrange_${RELEASE_VERSION}.orig.tar.gz 
+          cd lagrange-${RELEASE_VERSION}
+          debuild
+          cd ..
+          mkdir -p artifacts
+          mv *deb artifacts/
+        shell: bash
+      - name: plain-build
+        run: |
+          mkdir builddir
+          cd builddir
+          cmake .. -DCMAKE_BUILD_TYPE=Release
+          cmake --build .
+          mkdir -p ../artifacts/
+          tar -czvf ../artifacts/langrange-${RELEASE_VERSION}-linux-amd64.tar.gz lagrange
+          cd ..
+      - name: upload-artifact
+        uses: actions/upload-artifact@v2
+        with:
+          name: ubuntu-latest
+          path: artifacts
+  debian_build:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v2
+        with:
+          fetch-depth: '0'
+          submodules: 'recursive'
+      - name: get-repo-name
+        run: |
+          echo "REPOSITORY_NAME="$(echo $GITHUB_REPOSITORY | awk -F / '{print $2}' | sed -e "s/:refs//") >> $GITHUB_ENV
+        shell: bash
+      - name: install-dependencies
+        run: |
+          git submodule sync
+      - name: debian_docker
+        uses: ./.github/workflows/docker-debian/
+      - name: upload-debian-artifact
+        uses: actions/upload-artifact@v2
+        with:
+          name: debian
+          path: /home/runner/work/${{env.REPOSITORY_NAME}}/${{env.REPOSITORY_NAME}}/artifacts
diff --git a/.github/workflows/docker-debian/action.yml b/.github/workflows/docker-debian/action.yml
new file mode 100644
index 00000000..d510199b
--- /dev/null
+++ b/.github/workflows/docker-debian/action.yml
@@ -0,0 +1,4 @@
+name: 'docker'
+runs:
+  using: 'docker'
+  image: 'debian-dockerfile'
diff --git a/.github/workflows/docker-debian/debian-dockerfile b/.github/workflows/docker-debian/debian-dockerfile
new file mode 100644
index 00000000..147449a0
--- /dev/null
+++ b/.github/workflows/docker-debian/debian-dockerfile
@@ -0,0 +1,8 @@
+# Container image that runs your code
+FROM debian:buster
+
+# Copies your code file from your action repository to the filesystem path `/` of the container
+COPY entrypoint.sh /entrypoint.sh
+
+# Code file to execute when the docker container starts up (`entrypoint.sh`)
+ENTRYPOINT ["/entrypoint.sh"]
diff --git a/.github/workflows/docker-debian/entrypoint.sh b/.github/workflows/docker-debian/entrypoint.sh
new file mode 100755
index 00000000..94eb7e53
--- /dev/null
+++ b/.github/workflows/docker-debian/entrypoint.sh
@@ -0,0 +1,15 @@
+#!/bin/sh -xv
+
+apt-get update -qq -y
+apt-get install -y -qq --no-install-recommends cmake libsdl2-dev libssl-dev libpcre3-dev zlib1g-dev libunistring-dev libmpg123-dev debhelper dh-make devscripts fakeroot git build-essential
+git submodule sync
+
+git archive --format=tar.gz --prefix=lagrange-${RELEASE_VERSION}/ HEAD >lagrange-${RELEASE_VERSION}.tar.gz
+tar -xvzf lagrange-${RELEASE_VERSION}.tar.gz
+ln -s lagrange-${RELEASE_VERSION}.tar.gz lagrange_${RELEASE_VERSION}.orig.tar.gz 
+cd lagrange-${RELEASE_VERSION}
+debuild
+cd ..
+mkdir -p artifacts
+mv *deb artifacts/
+