summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorManos Pitsidianakis <el13635@mail.ntua.gr>2020-10-25 02:08:15 +0300
committerManos Pitsidianakis <el13635@mail.ntua.gr>2020-10-25 02:08:15 +0300
commitbcc61dc6eb62234947dd794a80b3e084a054164a (patch)
tree5f4ae5d53f0b893de37ce985213bf2669bc7acef /.github
parente5b6461ea3cf49254062387c0451cc0386a12b02 (diff)
Add github workflow for debian packaging
Builds can be triggered manually (`workflow_dispatch`) and by pushing a tagged release (`v*.*.*`) - There's a plain build done in an amd64 ubuntu-latest image and tar'ed - There's an amd64 ubuntu-latest deb package - There's an amd64 debian buster deb package made in a docker container Release is defined in the RELEASE_VERSION env var in the workflow configuration but must also be changed in the debian/ metadata.
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/build.yml70
-rw-r--r--.github/workflows/docker-debian/action.yml4
-rw-r--r--.github/workflows/docker-debian/debian-dockerfile8
-rwxr-xr-x.github/workflows/docker-debian/entrypoint.sh15
4 files changed, 97 insertions, 0 deletions
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 @@
1name: packages
2
3on:
4 push:
5 tags:
6 - 'v*.*.*'
7 workflow_dispatch:
8
9env:
10 RELEASE_VERSION: 0.6.1
11
12jobs:
13 build:
14 runs-on: ubuntu-latest
15 steps:
16 - uses: actions/checkout@v2
17 with:
18 fetch-depth: '0'
19 submodules: 'recursive'
20 - name: install-dependencies
21 run: |
22 git submodule sync
23 sudo apt-get update -qq -y
24 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
25 - name: package-build
26 run: |
27 git archive --format=tar.gz --prefix=lagrange-${RELEASE_VERSION}/ HEAD >lagrange-${RELEASE_VERSION}.tar.gz
28 tar -xvzf lagrange-${RELEASE_VERSION}.tar.gz
29 ln -s lagrange-${RELEASE_VERSION}.tar.gz lagrange_${RELEASE_VERSION}.orig.tar.gz
30 cd lagrange-${RELEASE_VERSION}
31 debuild
32 cd ..
33 mkdir -p artifacts
34 mv *deb artifacts/
35 shell: bash
36 - name: plain-build
37 run: |
38 mkdir builddir
39 cd builddir
40 cmake .. -DCMAKE_BUILD_TYPE=Release
41 cmake --build .
42 mkdir -p ../artifacts/
43 tar -czvf ../artifacts/langrange-${RELEASE_VERSION}-linux-amd64.tar.gz lagrange
44 cd ..
45 - name: upload-artifact
46 uses: actions/upload-artifact@v2
47 with:
48 name: ubuntu-latest
49 path: artifacts
50 debian_build:
51 runs-on: ubuntu-latest
52 steps:
53 - uses: actions/checkout@v2
54 with:
55 fetch-depth: '0'
56 submodules: 'recursive'
57 - name: get-repo-name
58 run: |
59 echo "REPOSITORY_NAME="$(echo $GITHUB_REPOSITORY | awk -F / '{print $2}' | sed -e "s/:refs//") >> $GITHUB_ENV
60 shell: bash
61 - name: install-dependencies
62 run: |
63 git submodule sync
64 - name: debian_docker
65 uses: ./.github/workflows/docker-debian/
66 - name: upload-debian-artifact
67 uses: actions/upload-artifact@v2
68 with:
69 name: debian
70 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 @@
1name: 'docker'
2runs:
3 using: 'docker'
4 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 @@
1# Container image that runs your code
2FROM debian:buster
3
4# Copies your code file from your action repository to the filesystem path `/` of the container
5COPY entrypoint.sh /entrypoint.sh
6
7# Code file to execute when the docker container starts up (`entrypoint.sh`)
8ENTRYPOINT ["/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 @@
1#!/bin/sh -xv
2
3apt-get update -qq -y
4apt-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
5git submodule sync
6
7git archive --format=tar.gz --prefix=lagrange-${RELEASE_VERSION}/ HEAD >lagrange-${RELEASE_VERSION}.tar.gz
8tar -xvzf lagrange-${RELEASE_VERSION}.tar.gz
9ln -s lagrange-${RELEASE_VERSION}.tar.gz lagrange_${RELEASE_VERSION}.orig.tar.gz
10cd lagrange-${RELEASE_VERSION}
11debuild
12cd ..
13mkdir -p artifacts
14mv *deb artifacts/
15