-
Notifications
You must be signed in to change notification settings - Fork 17
85 lines (83 loc) · 2.79 KB
/
debian-packaging.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: Debian
on: push
env:
CHANGELOG_AUTHOR_NAME: "Thomas Calderon"
CHANGELOG_AUTHOR_EMAIL: "calderon.thomas@gmail.com"
DEB_OUTPUT: "/tmp/cc-output"
DEB_OUTPUT_CONTAINER: "/tmp/output"
jobs:
build-debian-package:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- dist: "debian"
flavor: "sid"
# - dist: "debian"
# flavor: "testing"
# - dist: "debian"
# flavor: "bullseye"
# - dist: "debian"
# flavor: "buster"
# # Ubuntu Focal does not have coccinelle package, skip for now
# # - dist: "ubuntu"
# # flavor: "focal"
# - dist: "ubuntu"
# flavor: "bionic"
# - dist: "ubuntu"
# flavor: "xenial"
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Get branch name (merge)
if: github.event_name != 'pull_request'
shell: bash
run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV
- name: Get branch name (pull request)
if: github.event_name == 'pull_request'
shell: bash
run: echo "BRANCH_NAME=$(echo ${GITHUB_HEAD_REF} | tr / -)" >> $GITHUB_ENV
- name: Show branch detail
shell: bash
run: echo "echo ${BRANCH_NAME}"
- name: build docker container to build
env:
DIST: ${{ matrix.dist }}
FLAVOR: ${{ matrix.flavor }}
run: |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository \
"deb https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
sudo apt-get update
sudo apt-get install -y --no-install-recommends docker-ce
docker build -t caml-crush-pkg-${FLAVOR} \
--build-arg flavor=${DIST} \
--build-arg flavor=${FLAVOR} \
-f Dockerfile.debian-pkg .
# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v3
- name: build package in container
env:
DIST: ${{ matrix.dist }}
FLAVOR: ${{ matrix.flavor }}
BRANCH_NAME: ${{ env.BRANCH_NAME }}
DEB_OUTPUT: ${{ env.DEB_OUTPUT }}
DEB_OUTPUT_CONTAINER: ${{ env.DEB_OUTPUT_CONTAINER }}
run: |
mkdir -p ${DEB_OUTPUT}
docker run --rm \
-e BRANCH_NAME=${BRANCH_NAME} \
-e DEB_OUTPUT_CONTAINER=${DEB_OUTPUT_CONTAINER} \
-v ${DEB_OUTPUT}:${DEB_OUTPUT_CONTAINER} \
caml-crush-pkg-${FLAVOR} \
bash -x .github/build-pkg-git.sh
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: deb
path: ${{env.DEB_OUTPUT}}/
if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn`